diff --git a/sdk/advisor/ci.mgmt.yml b/sdk/advisor/ci.mgmt.yml index 6b9f8d6952e6..22df99de35f2 100644 --- a/sdk/advisor/ci.mgmt.yml +++ b/sdk/advisor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/advisor/ci.mgmt.yml - sdk/advisor/Azure.ResourceManager.Advisor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/advisor/ci.mgmt.yml + - sdk/advisor/Azure.ResourceManager.Advisor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/agrifood/ci.mgmt.yml b/sdk/agrifood/ci.mgmt.yml index ee27d71f9495..03a5f6399ccb 100644 --- a/sdk/agrifood/ci.mgmt.yml +++ b/sdk/agrifood/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/agrifood/ci.mgmt.yml - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/agrifood/ci.mgmt.yml + - sdk/agrifood/Azure.ResourceManager.AgFoodPlatform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/alertsmanagement/ci.mgmt.yml b/sdk/alertsmanagement/ci.mgmt.yml index f33a90fffe5c..ad3a8d3d1efd 100644 --- a/sdk/alertsmanagement/ci.mgmt.yml +++ b/sdk/alertsmanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/alertsmanagement/ci.mgmt.yml - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/alertsmanagement/ci.mgmt.yml + - sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/analysisservices/ci.mgmt.yml b/sdk/analysisservices/ci.mgmt.yml index 33729b962d88..d3774b358380 100644 --- a/sdk/analysisservices/ci.mgmt.yml +++ b/sdk/analysisservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/analysisservices/ci.mgmt.yml - sdk/analysisservices/Azure.ResourceManager.Analysis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/analysisservices/ci.mgmt.yml + - sdk/analysisservices/Azure.ResourceManager.Analysis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/apicenter/ci.mgmt.yml b/sdk/apicenter/ci.mgmt.yml index 41c037327e33..4882d4409c0b 100644 --- a/sdk/apicenter/ci.mgmt.yml +++ b/sdk/apicenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/apicenter/ci.mgmt.yml - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apicenter/ci.mgmt.yml + - sdk/apicenter/Azure.ResourceManager.ApiCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/apimanagement/ci.mgmt.yml b/sdk/apimanagement/ci.mgmt.yml index b72c80a2e0e6..2f766edb9528 100644 --- a/sdk/apimanagement/ci.mgmt.yml +++ b/sdk/apimanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/apimanagement/ci.mgmt.yml - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/apimanagement/ci.mgmt.yml + - sdk/apimanagement/Azure.ResourceManager.ApiManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appcomplianceautomation/ci.mgmt.yml b/sdk/appcomplianceautomation/ci.mgmt.yml index d8a31e0139a8..7c3b00d97c17 100644 --- a/sdk/appcomplianceautomation/ci.mgmt.yml +++ b/sdk/appcomplianceautomation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/appcomplianceautomation/ci.mgmt.yml - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appcomplianceautomation/ci.mgmt.yml + - sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appconfiguration/ci.mgmt.yml b/sdk/appconfiguration/ci.mgmt.yml index a883eaefcd59..e53dd63aca0f 100644 --- a/sdk/appconfiguration/ci.mgmt.yml +++ b/sdk/appconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/appconfiguration/ci.mgmt.yml - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appconfiguration/ci.mgmt.yml + - sdk/appconfiguration/Azure.ResourceManager.AppConfiguration/ + # These comments should stay. extends: diff --git a/sdk/applicationinsights/ci.mgmt.yml b/sdk/applicationinsights/ci.mgmt.yml index af82b66e6952..361f4019d322 100644 --- a/sdk/applicationinsights/ci.mgmt.yml +++ b/sdk/applicationinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/applicationinsights/ci.mgmt.yml - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/applicationinsights/ci.mgmt.yml + - sdk/applicationinsights/Azure.ResourceManager.ApplicationInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/appplatform/ci.mgmt.yml b/sdk/appplatform/ci.mgmt.yml index 1d28b9352b6c..023cebeb8d71 100644 --- a/sdk/appplatform/ci.mgmt.yml +++ b/sdk/appplatform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/appplatform/ci.mgmt.yml - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/appplatform/ci.mgmt.yml + - sdk/appplatform/Azure.ResourceManager.AppPlatform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/arc-scvmm/ci.mgmt.yml b/sdk/arc-scvmm/ci.mgmt.yml index bbc2db0c9f63..53438df9d332 100644 --- a/sdk/arc-scvmm/ci.mgmt.yml +++ b/sdk/arc-scvmm/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/arc-scvmm/ci.mgmt.yml - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/arc-scvmm/ci.mgmt.yml + - sdk/arc-scvmm/Azure.ResourceManager.ScVmm/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/astronomer/ci.mgmt.yml b/sdk/astronomer/ci.mgmt.yml index f6099036651c..d0de6d52b29a 100644 --- a/sdk/astronomer/ci.mgmt.yml +++ b/sdk/astronomer/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/astronomer/ci.mgmt.yml - sdk/astronomer/Azure.ResourceManager.Astro/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/astronomer/ci.mgmt.yml + - sdk/astronomer/Azure.ResourceManager.Astro/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/attestation/ci.mgmt.yml b/sdk/attestation/ci.mgmt.yml index 51d1ac0c8240..595f887b2c35 100644 --- a/sdk/attestation/ci.mgmt.yml +++ b/sdk/attestation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/attestation/ci.mgmt.yml - sdk/attestation/Azure.ResourceManager.Attestation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/attestation/ci.mgmt.yml + - sdk/attestation/Azure.ResourceManager.Attestation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/authorization/ci.mgmt.yml b/sdk/authorization/ci.mgmt.yml index 7ac32fcc5543..9c9d9638348d 100644 --- a/sdk/authorization/ci.mgmt.yml +++ b/sdk/authorization/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/authorization/ci.mgmt.yml - sdk/authorization/Azure.ResourceManager.Authorization/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/authorization/ci.mgmt.yml + - sdk/authorization/Azure.ResourceManager.Authorization/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/automanage/ci.mgmt.yml b/sdk/automanage/ci.mgmt.yml index 5a2467820b85..8e45b6506aa8 100644 --- a/sdk/automanage/ci.mgmt.yml +++ b/sdk/automanage/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/automanage/ci.mgmt.yml - sdk/automanage/Azure.ResourceManager.Automanage/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automanage/ci.mgmt.yml + - sdk/automanage/Azure.ResourceManager.Automanage/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/automation/ci.mgmt.yml b/sdk/automation/ci.mgmt.yml index 45bec5d1c196..b2cb0f44bf22 100644 --- a/sdk/automation/ci.mgmt.yml +++ b/sdk/automation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/automation/ci.mgmt.yml - sdk/automation/Azure.ResourceManager.Automation/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/automation/ci.mgmt.yml + - sdk/automation/Azure.ResourceManager.Automation/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/avs/ci.mgmt.yml b/sdk/avs/ci.mgmt.yml index 6404a2ba34ce..7030303dc9f4 100644 --- a/sdk/avs/ci.mgmt.yml +++ b/sdk/avs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/avs/ci.mgmt.yml - sdk/avs/Azure.ResourceManager.Avs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/avs/ci.mgmt.yml + - sdk/avs/Azure.ResourceManager.Avs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/azurelargeinstance/ci.mgmt.yml b/sdk/azurelargeinstance/ci.mgmt.yml index fbe98927ef15..d9425419d2c3 100644 --- a/sdk/azurelargeinstance/ci.mgmt.yml +++ b/sdk/azurelargeinstance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/azurelargeinstance/ci.mgmt.yml - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurelargeinstance/ci.mgmt.yml + - sdk/azurelargeinstance/Azure.ResourceManager.LargeInstance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/azurestackhci/ci.mgmt.yml b/sdk/azurestackhci/ci.mgmt.yml index 89c22080e00c..167241c22e36 100644 --- a/sdk/azurestackhci/ci.mgmt.yml +++ b/sdk/azurestackhci/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/azurestackhci/ci.mgmt.yml - sdk/azurestackhci/Azure.ResourceManager.Hci/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/azurestackhci/ci.mgmt.yml + - sdk/azurestackhci/Azure.ResourceManager.Hci/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/batch/ci.mgmt.yml b/sdk/batch/ci.mgmt.yml index fdb37873525c..57a9135b3c71 100644 --- a/sdk/batch/ci.mgmt.yml +++ b/sdk/batch/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/batch/ci.mgmt.yml - sdk/batch/Azure.ResourceManager.Batch/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/batch/ci.mgmt.yml + - sdk/batch/Azure.ResourceManager.Batch/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/billing/ci.mgmt.yml b/sdk/billing/ci.mgmt.yml index 67cf904850c6..0efcab4a9c90 100644 --- a/sdk/billing/ci.mgmt.yml +++ b/sdk/billing/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/billing/ci.mgmt.yml - sdk/billing/Azure.ResourceManager.Billing/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billing/ci.mgmt.yml + - sdk/billing/Azure.ResourceManager.Billing/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/billingbenefits/ci.mgmt.yml b/sdk/billingbenefits/ci.mgmt.yml index 9900a842be4f..d2d1e939d8cd 100644 --- a/sdk/billingbenefits/ci.mgmt.yml +++ b/sdk/billingbenefits/ci.mgmt.yml @@ -2,6 +2,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/billingbenefits/ci.mgmt.yml - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/billingbenefits/ci.mgmt.yml + - sdk/billingbenefits/Azure.ResourceManager.BillingBenefits/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/blueprint/ci.mgmt.yml b/sdk/blueprint/ci.mgmt.yml index 65bd23b77f51..6524937da4ee 100644 --- a/sdk/blueprint/ci.mgmt.yml +++ b/sdk/blueprint/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/blueprint/ci.mgmt.yml - sdk/blueprint/Azure.ResourceManager.Blueprint/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/blueprint/ci.mgmt.yml + - sdk/blueprint/Azure.ResourceManager.Blueprint/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/botservice/ci.mgmt.yml b/sdk/botservice/ci.mgmt.yml index 8e5444ff3f9a..3e991a6ebab1 100644 --- a/sdk/botservice/ci.mgmt.yml +++ b/sdk/botservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/botservice/ci.mgmt.yml - sdk/botservice/Azure.ResourceManager.BotService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/botservice/ci.mgmt.yml + - sdk/botservice/Azure.ResourceManager.BotService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cdn/ci.mgmt.yml b/sdk/cdn/ci.mgmt.yml index ac2ea82249d1..f1932c6d31b9 100644 --- a/sdk/cdn/ci.mgmt.yml +++ b/sdk/cdn/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/cdn/ci.mgmt.yml - sdk/cdn/Azure.ResourceManager.Cdn/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cdn/ci.mgmt.yml + - sdk/cdn/Azure.ResourceManager.Cdn/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/changeanalysis/ci.mgmt.yml b/sdk/changeanalysis/ci.mgmt.yml index 65c6e90d195a..aee7612c339f 100644 --- a/sdk/changeanalysis/ci.mgmt.yml +++ b/sdk/changeanalysis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/changeanalysis/ci.mgmt.yml - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/changeanalysis/ci.mgmt.yml + - sdk/changeanalysis/Azure.ResourceManager.ChangeAnalysis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/chaos/ci.mgmt.yml b/sdk/chaos/ci.mgmt.yml index 585591bcb6bd..a74922d27932 100644 --- a/sdk/chaos/ci.mgmt.yml +++ b/sdk/chaos/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/chaos/ci.mgmt.yml - sdk/chaos/Azure.ResourceManager.Chaos/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/chaos/ci.mgmt.yml + - sdk/chaos/Azure.ResourceManager.Chaos/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cognitiveservices/ci.mgmt.yml b/sdk/cognitiveservices/ci.mgmt.yml index ddeb32b868ce..79dda70912e2 100644 --- a/sdk/cognitiveservices/ci.mgmt.yml +++ b/sdk/cognitiveservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/cognitiveservices/ci.mgmt.yml - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cognitiveservices/ci.mgmt.yml + - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/communication/ci.mgmt.yml b/sdk/communication/ci.mgmt.yml index 8fc73e107745..be0c8b4b5903 100644 --- a/sdk/communication/ci.mgmt.yml +++ b/sdk/communication/ci.mgmt.yml @@ -1,5 +1,6 @@ trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/communication/ci.mgmt.yml - sdk/communication/Azure.ResourceManager.Communication/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/communication/ci.mgmt.yml + - sdk/communication/Azure.ResourceManager.Communication/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/compute/ci.mgmt.yml b/sdk/compute/ci.mgmt.yml index d9520f58d12c..9736fea82d63 100644 --- a/sdk/compute/ci.mgmt.yml +++ b/sdk/compute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/compute/ci.mgmt.yml - sdk/compute/Azure.ResourceManager.Compute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/compute/ci.mgmt.yml + - sdk/compute/Azure.ResourceManager.Compute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/computefleet/ci.mgmt.yml b/sdk/computefleet/ci.mgmt.yml index de169e18c599..58fc15347c98 100644 --- a/sdk/computefleet/ci.mgmt.yml +++ b/sdk/computefleet/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/computefleet/ci.mgmt.yml - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/computeschedule/ci.mgmt.yml b/sdk/computeschedule/ci.mgmt.yml index d3a367f82551..01d026ef37ea 100644 --- a/sdk/computeschedule/ci.mgmt.yml +++ b/sdk/computeschedule/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/computeschedule/ci.mgmt.yml - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computeschedule/ci.mgmt.yml + - sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/confidentialledger/ci.mgmt.yml b/sdk/confidentialledger/ci.mgmt.yml index 7343d843f2ee..b61c498ed14a 100644 --- a/sdk/confidentialledger/ci.mgmt.yml +++ b/sdk/confidentialledger/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/confidentialledger/ci.mgmt.yml - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confidentialledger/ci.mgmt.yml + - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/confluent/ci.mgmt.yml b/sdk/confluent/ci.mgmt.yml index 12d37aa41bd2..757508d306f9 100644 --- a/sdk/confluent/ci.mgmt.yml +++ b/sdk/confluent/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/confluent/ci.mgmt.yml - sdk/confluent/Azure.ResourceManager.Confluent/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/confluent/ci.mgmt.yml + - sdk/confluent/Azure.ResourceManager.Confluent/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/connectedvmwarevsphere/ci.mgmt.yml b/sdk/connectedvmwarevsphere/ci.mgmt.yml index a9d0db85cf82..f8990a206c45 100644 --- a/sdk/connectedvmwarevsphere/ci.mgmt.yml +++ b/sdk/connectedvmwarevsphere/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/connectedvmwarevsphere/ci.mgmt.yml - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/connectedvmwarevsphere/ci.mgmt.yml + - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/consumption/ci.mgmt.yml b/sdk/consumption/ci.mgmt.yml index 6b0ebe2b2fa7..ccda85ce5789 100644 --- a/sdk/consumption/ci.mgmt.yml +++ b/sdk/consumption/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/consumption/ci.mgmt.yml - sdk/consumption/Azure.ResourceManager.Consumption/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/consumption/ci.mgmt.yml + - sdk/consumption/Azure.ResourceManager.Consumption/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerapps/ci.mgmt.yml b/sdk/containerapps/ci.mgmt.yml index 7715d499fa59..69564e2f1920 100644 --- a/sdk/containerapps/ci.mgmt.yml +++ b/sdk/containerapps/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerapps/ci.mgmt.yml - sdk/containerapps/Azure.ResourceManager.AppContainers/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerapps/ci.mgmt.yml + - sdk/containerapps/Azure.ResourceManager.AppContainers/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerinstance/ci.mgmt.yml b/sdk/containerinstance/ci.mgmt.yml index 0b4d90bf6d1c..865705313c2c 100644 --- a/sdk/containerinstance/ci.mgmt.yml +++ b/sdk/containerinstance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerinstance/ci.mgmt.yml - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerinstance/ci.mgmt.yml + - sdk/containerinstance/Azure.ResourceManager.ContainerInstance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerorchestratorruntime/ci.mgmt.yml b/sdk/containerorchestratorruntime/ci.mgmt.yml index 0a036386143b..98ade1bcf8c6 100644 --- a/sdk/containerorchestratorruntime/ci.mgmt.yml +++ b/sdk/containerorchestratorruntime/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerorchestratorruntime/ci.mgmt.yml - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerorchestratorruntime/ci.mgmt.yml + - sdk/containerorchestratorruntime/Azure.ResourceManager.ContainerOrchestratorRuntime/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerregistry/ci.mgmt.yml b/sdk/containerregistry/ci.mgmt.yml index e3f0cfb5bfa5..5fa9fce02790 100644 --- a/sdk/containerregistry/ci.mgmt.yml +++ b/sdk/containerregistry/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerregistry/ci.mgmt.yml - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerregistry/ci.mgmt.yml + - sdk/containerregistry/Azure.ResourceManager.ContainerRegistry/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/containerservice/ci.mgmt.yml b/sdk/containerservice/ci.mgmt.yml index 9eb58047b02e..8eb615e701f7 100644 --- a/sdk/containerservice/ci.mgmt.yml +++ b/sdk/containerservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/containerservice/ci.mgmt.yml - sdk/containerservice/Azure.ResourceManager.ContainerService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/containerservice/ci.mgmt.yml + - sdk/containerservice/Azure.ResourceManager.ContainerService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cosmosdb/ci.mgmt.yml b/sdk/cosmosdb/ci.mgmt.yml index 1eab24b3bbf9..ac1fce954c2a 100644 --- a/sdk/cosmosdb/ci.mgmt.yml +++ b/sdk/cosmosdb/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/cosmosdb/ci.mgmt.yml - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdb/ci.mgmt.yml + - sdk/cosmosdb/Azure.ResourceManager.CosmosDB/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/cosmosdbforpostgresql/ci.mgmt.yml b/sdk/cosmosdbforpostgresql/ci.mgmt.yml index ef6098c3999f..bfe2761181a8 100644 --- a/sdk/cosmosdbforpostgresql/ci.mgmt.yml +++ b/sdk/cosmosdbforpostgresql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/cosmosdbforpostgresql/ci.mgmt.yml - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/cosmosdbforpostgresql/ci.mgmt.yml + - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/costmanagement/ci.mgmt.yml b/sdk/costmanagement/ci.mgmt.yml index e59280ba6be2..cee9459831fb 100644 --- a/sdk/costmanagement/ci.mgmt.yml +++ b/sdk/costmanagement/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/costmanagement/ci.mgmt.yml - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/costmanagement/ci.mgmt.yml + - sdk/costmanagement/Azure.ResourceManager.CostManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/customer-insights/ci.mgmt.yml b/sdk/customer-insights/ci.mgmt.yml index 124af418dcfa..a5d4f1a60cb5 100644 --- a/sdk/customer-insights/ci.mgmt.yml +++ b/sdk/customer-insights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/customer-insights/ci.mgmt.yml - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/customer-insights/ci.mgmt.yml + - sdk/customer-insights/Azure.ResourceManager.CustomerInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/databox/ci.mgmt.yml b/sdk/databox/ci.mgmt.yml index edd63a701700..6525b0b436cc 100644 --- a/sdk/databox/ci.mgmt.yml +++ b/sdk/databox/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/databox/ci.mgmt.yml - sdk/databox/Azure.ResourceManager.DataBox/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databox/ci.mgmt.yml + - sdk/databox/Azure.ResourceManager.DataBox/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/databoxedge/ci.mgmt.yml b/sdk/databoxedge/ci.mgmt.yml index 29e3b1537c78..3cf952bd82f3 100644 --- a/sdk/databoxedge/ci.mgmt.yml +++ b/sdk/databoxedge/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/databoxedge/ci.mgmt.yml - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/databoxedge/ci.mgmt.yml + - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datadog/ci.mgmt.yml b/sdk/datadog/ci.mgmt.yml index 9e9d6825d8b0..c1b66f6edb09 100644 --- a/sdk/datadog/ci.mgmt.yml +++ b/sdk/datadog/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datadog/ci.mgmt.yml - sdk/datadog/Azure.ResourceManager.Datadog/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datadog/ci.mgmt.yml + - sdk/datadog/Azure.ResourceManager.Datadog/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datafactory/ci.mgmt.yml b/sdk/datafactory/ci.mgmt.yml index 85d246a5d4e7..1f1a4ba295cd 100644 --- a/sdk/datafactory/ci.mgmt.yml +++ b/sdk/datafactory/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datafactory/ci.mgmt.yml - sdk/datafactory/Azure.ResourceManager.DataFactory/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datafactory/ci.mgmt.yml + - sdk/datafactory/Azure.ResourceManager.DataFactory/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datalake-analytics/ci.mgmt.yml b/sdk/datalake-analytics/ci.mgmt.yml index b8794cd18f9e..44823b2f9444 100644 --- a/sdk/datalake-analytics/ci.mgmt.yml +++ b/sdk/datalake-analytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datalake-analytics/ci.mgmt.yml - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-analytics/ci.mgmt.yml + - sdk/datalake-analytics/Azure.ResourceManager.DataLakeAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datalake-store/ci.mgmt.yml b/sdk/datalake-store/ci.mgmt.yml index 469839fd3024..27295ad1c28c 100644 --- a/sdk/datalake-store/ci.mgmt.yml +++ b/sdk/datalake-store/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datalake-store/ci.mgmt.yml - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datalake-store/ci.mgmt.yml + - sdk/datalake-store/Azure.ResourceManager.DataLakeStore/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datamigration/ci.mgmt.yml b/sdk/datamigration/ci.mgmt.yml index 1e64024fed17..f26452e1de48 100644 --- a/sdk/datamigration/ci.mgmt.yml +++ b/sdk/datamigration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datamigration/ci.mgmt.yml - sdk/datamigration/Azure.ResourceManager.DataMigration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datamigration/ci.mgmt.yml + - sdk/datamigration/Azure.ResourceManager.DataMigration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dataprotection/ci.mgmt.yml b/sdk/dataprotection/ci.mgmt.yml index 25637090aedb..0b74e9436cc7 100644 --- a/sdk/dataprotection/ci.mgmt.yml +++ b/sdk/dataprotection/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/dataprotection/ci.mgmt.yml - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dataprotection/ci.mgmt.yml + - sdk/dataprotection/Azure.ResourceManager.DataProtectionBackup/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/datashare/ci.mgmt.yml b/sdk/datashare/ci.mgmt.yml index f6dd41e0f37f..dcb3801e3f58 100644 --- a/sdk/datashare/ci.mgmt.yml +++ b/sdk/datashare/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/datashare/ci.mgmt.yml - sdk/datashare/Azure.ResourceManager.DataShare/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/datashare/ci.mgmt.yml + - sdk/datashare/Azure.ResourceManager.DataShare/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/defendereasm/ci.mgmt.yml b/sdk/defendereasm/ci.mgmt.yml index dd90e5a46690..2dc5c04ec007 100644 --- a/sdk/defendereasm/ci.mgmt.yml +++ b/sdk/defendereasm/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/defendereasm/ci.mgmt.yml - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/defendereasm/ci.mgmt.yml + - sdk/defendereasm/Azure.ResourceManager.DefenderEasm/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ActiveSessionHostConfigurationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ActiveSessionHostConfigurationResource.cs new file mode 100644 index 000000000000..5698f075ec83 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ActiveSessionHostConfigurationResource.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_ActiveSessionHostConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SessionHostConfigurationsGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ActiveSessionHostConfigurations_Get.json + // this example is just showing the usage of "ActiveSessionHostConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ActiveSessionHostConfigurationResource created on azure + // for more information of creating ActiveSessionHostConfigurationResource, please refer to the document of ActiveSessionHostConfigurationResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier activeSessionHostConfigurationResourceId = ActiveSessionHostConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + ActiveSessionHostConfigurationResource activeSessionHostConfiguration = client.GetActiveSessionHostConfigurationResource(activeSessionHostConfigurationResourceId); + + // invoke the operation + ActiveSessionHostConfigurationResource result = await activeSessionHostConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ActiveSessionHostConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageCollection.cs index b977dc337511..e0f223f69438 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_AppAttachPackageCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_AppAttachPackageCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Create.json // this example is just showing the usage of "AppAttachPackage_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,6 +78,8 @@ public async Task CreateOrUpdate_AppAttachPackageCreate() HostPoolReferences = { }, KeyVaultUri = new Uri(""), FailHealthCheckOnStagingFailure = FailHealthCheckOnStagingFailure.NeedsAssistance, + PackageOwnerName = "App Attach", + CustomData = "", }); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, appAttachPackageName, data); AppAttachPackageResource result = lro.Value; @@ -93,7 +95,7 @@ public async Task CreateOrUpdate_AppAttachPackageCreate() [Ignore("Only validating compilation of examples")] public async Task Get_AppAttachPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Get.json // this example is just showing the usage of "AppAttachPackage_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +128,7 @@ public async Task Get_AppAttachPackageGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_AppAttachPackageListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_ListByResourceGroup.json // this example is just showing the usage of "AppAttachPackage_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +164,7 @@ public async Task GetAll_AppAttachPackageListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_AppAttachPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Get.json // this example is just showing the usage of "AppAttachPackage_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,7 +193,7 @@ public async Task Exists_AppAttachPackageGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_AppAttachPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Get.json // this example is just showing the usage of "AppAttachPackage_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageResource.cs index b7a1106b3f98..bd1f541bca4c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_AppAttachPackageResource.cs @@ -20,7 +20,7 @@ public partial class Sample_AppAttachPackageResource [Ignore("Only validating compilation of examples")] public async Task Get_AppAttachPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Get.json // this example is just showing the usage of "AppAttachPackage_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_AppAttachPackageGet() [Ignore("Only validating compilation of examples")] public async Task Delete_AppAttachPackageDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Delete.json // this example is just showing the usage of "AppAttachPackage_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_AppAttachPackageDelete() [Ignore("Only validating compilation of examples")] public async Task Update_AppAttachPackageUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Update.json // this example is just showing the usage of "AppAttachPackage_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs index 7e1c9a5c3c7b..ca4f88674b89 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_HostPoolCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_HostPoolCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Create.json // this example is just showing the usage of "HostPools_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,6 +54,7 @@ public async Task CreateOrUpdate_HostPoolCreate() RegistrationTokenOperation = HostPoolRegistrationTokenOperation.Update, }, VmTemplate = "{json:json}", + ManagementType = ManagementType.Automated, SsoAdfsAuthority = "https://adfs", SsoClientId = "client", SsoClientSecretKeyVaultPath = "https://keyvault/secret", @@ -74,6 +75,10 @@ public async Task CreateOrUpdate_HostPoolCreate() DayOfWeek = DesktopVirtualizationDayOfWeek.Saturday, }}, }, + ManagedPrivateUDP = ManagedPrivateUDP.Enabled, + DirectUDP = DirectUDP.Enabled, + PublicUDP = PublicUDP.Enabled, + RelayUDP = RelayUDP.Enabled, Tags = { ["tag1"] = "value1", @@ -94,7 +99,7 @@ public async Task CreateOrUpdate_HostPoolCreate() [Ignore("Only validating compilation of examples")] public async Task Get_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +132,7 @@ public async Task Get_HostPoolGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_HostPoolListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_ListByResourceGroup.json // this example is just showing the usage of "HostPools_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +170,7 @@ public async Task GetAll_HostPoolListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +199,7 @@ public async Task Exists_HostPoolGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs index 56146b119bce..bc51200cedf3 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HostPoolPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionUpdateByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_UpdateByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_UpdateByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_UpdateByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionUpdateByHostPool() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGetByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_PrivateEndpointConnectionGetByHostPool() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateEndpointConnectionListByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_ListByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_ListByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_ListByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task GetAll_PrivateEndpointConnectionListByHostPool() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGetByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_PrivateEndpointConnectionGetByHostPool() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGetByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs index aea8c7840276..d8d79fff8d8a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HostPoolPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGetByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_GetByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGetByHostPool() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionDeleteByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_DeleteByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_DeleteByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_PrivateEndpointConnectionDeleteByHostPool() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionUpdateByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_UpdateByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_UpdateByHostPool.json // this example is just showing the usage of "PrivateEndpointConnections_UpdateByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs index 6da17ec4fed6..5d41bd222e24 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_HostPoolResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HostPoolResource [Ignore("Only validating compilation of examples")] public async Task Get_HostPoolGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Get.json // this example is just showing the usage of "HostPools_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_HostPoolGet() [Ignore("Only validating compilation of examples")] public async Task Delete_HostPoolDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Delete.json // this example is just showing the usage of "HostPools_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task Delete_HostPoolDelete() [Ignore("Only validating compilation of examples")] public async Task Update_HostPoolUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Update.json // this example is just showing the usage of "HostPools_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -133,6 +133,10 @@ public async Task Update_HostPoolUpdate() DayOfWeek = DesktopVirtualizationDayOfWeek.Saturday, }}, }, + ManagedPrivateUDP = ManagedPrivateUDP.Enabled, + DirectUDP = DirectUDP.Enabled, + PublicUDP = PublicUDP.Enabled, + RelayUDP = RelayUDP.Enabled, }; HostPoolResource result = await hostPool.UpdateAsync(patch); @@ -147,7 +151,7 @@ public async Task Update_HostPoolUpdate() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResources_PrivateLinkResourcesListByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateLinkResources_ListByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateLinkResources_ListByHostPool.json // this example is just showing the usage of "PrivateLinkResources_ListByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +180,7 @@ public async Task GetPrivateLinkResources_PrivateLinkResourcesListByHostPool() [Ignore("Only validating compilation of examples")] public async Task GetScalingPlans_ScalingPlanListByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_ListByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_ListByHostPool.json // this example is just showing the usage of "ScalingPlans_ListByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -212,7 +216,7 @@ public async Task GetScalingPlans_ScalingPlanListByHostPool() [Ignore("Only validating compilation of examples")] public async Task RetrieveRegistrationToken_HostPoolsRetrieveRegistrationTokenPost() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPools_RetrieveRegistrationToken_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPools_RetrieveRegistrationToken_Post.json // this example is just showing the usage of "HostPools_RetrieveRegistrationToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,11 +238,40 @@ public async Task RetrieveRegistrationToken_HostPoolsRetrieveRegistrationTokenPo Console.WriteLine($"Succeeded: {result}"); } + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetRegistrationTokens_HostPoolsListRegistrationTokenPost() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPools_ListRegistrationToken_Post.json + // this example is just showing the usage of "HostPools_ListRegistrationTokens" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostPoolResource created on azure + // for more information of creating HostPoolResource, please refer to the document of HostPoolResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier hostPoolResourceId = HostPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + HostPoolResource hostPool = client.GetHostPoolResource(hostPoolResourceId); + + // invoke the operation and iterate over the result + await foreach (RegistrationTokenMinimal item in hostPool.GetRegistrationTokensAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task GetUserSessions_UserSessionListByHostPool() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_ListByHostPool.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_ListByHostPool.json // this example is just showing the usage of "UserSessions_ListByHostPool" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -275,7 +308,7 @@ public async Task GetUserSessions_UserSessionListByHostPool() [Ignore("Only validating compilation of examples")] public async Task ImportAppAttachPackageInfos_AppAttachPackageInfoImport() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackageInfo_Import_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackageInfo_Import_Post.json // this example is just showing the usage of "AppAttachPackageInfo_Import" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -313,7 +346,7 @@ public async Task ImportAppAttachPackageInfos_AppAttachPackageInfoImport() [Ignore("Only validating compilation of examples")] public async Task ExpandMsixImages_MsixImageExpand() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixImage_Expand_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixImage_Expand_Post.json // this example is just showing the usage of "MsixImages_Expand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs index 7e6368e6b423..64fd9edfa2a8 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MsixPackageCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_MSIXPackageCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Create.json // this example is just showing the usage of "MSIXPackages_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task CreateOrUpdate_MSIXPackageCreate() [Ignore("Only validating compilation of examples")] public async Task Get_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Get_MSIXPackageGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_MSIXPackageList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_List.json // this example is just showing the usage of "MSIXPackages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task GetAll_MSIXPackageList() [Ignore("Only validating compilation of examples")] public async Task Exists_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +186,7 @@ public async Task Exists_MSIXPackageGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs index cd2ff7e4eae1..18c9e61cb3b5 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_MsixPackageResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MsixPackageResource [Ignore("Only validating compilation of examples")] public async Task Get_MSIXPackageGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Get.json // this example is just showing the usage of "MSIXPackages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_MSIXPackageGet() [Ignore("Only validating compilation of examples")] public async Task Delete_MSIXPackageDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Delete.json // this example is just showing the usage of "MSIXPackages_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_MSIXPackageDelete() [Ignore("Only validating compilation of examples")] public async Task Update_MSIXPackageUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Update.json // this example is just showing the usage of "MSIXPackages_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs index 85c1f46fdecf..97091678eeda 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ScalingPlanCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ScalingPlansCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Create.json // this example is just showing the usage of "ScalingPlans_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task CreateOrUpdate_ScalingPlansCreate() Schedules = {new ScalingSchedule { Name = "schedule1", -DaysOfWeek = {ScalingScheduleDaysOfWeekItem.Monday, ScalingScheduleDaysOfWeekItem.Tuesday, ScalingScheduleDaysOfWeekItem.Wednesday, ScalingScheduleDaysOfWeekItem.Thursday, ScalingScheduleDaysOfWeekItem.Friday}, +DaysOfWeek = {DesktopVirtualizationDayOfWeek.Monday, DesktopVirtualizationDayOfWeek.Tuesday, DesktopVirtualizationDayOfWeek.Wednesday, DesktopVirtualizationDayOfWeek.Thursday, DesktopVirtualizationDayOfWeek.Friday}, RampUpStartTime = new ScalingActionTime(6, 0), RampUpLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.DepthFirst, RampUpMinimumHostsPct = 20, @@ -92,7 +92,7 @@ public async Task CreateOrUpdate_ScalingPlansCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Get_ScalingPlansGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ScalingPlansListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_ListByResourceGroup.json // this example is just showing the usage of "ScalingPlans_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +163,7 @@ public async Task GetAll_ScalingPlansListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -192,7 +192,7 @@ public async Task Exists_ScalingPlansGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs index cfddb58b35aa..6fec88e83296 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ScalingPlanPersonalScheduleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ScalingPlanPersonalSchedulesCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Create.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,29 +41,24 @@ public async Task CreateOrUpdate_ScalingPlanPersonalSchedulesCreate() // invoke the operation string scalingPlanScheduleName = "scalingPlanScheduleWeekdays1"; - ScalingPlanPersonalScheduleData data = new ScalingPlanPersonalScheduleData + ScalingPlanPersonalScheduleData data = new ScalingPlanPersonalScheduleData(new DesktopVirtualizationDayOfWeek[] { DesktopVirtualizationDayOfWeek.Monday, DesktopVirtualizationDayOfWeek.Tuesday, DesktopVirtualizationDayOfWeek.Wednesday, DesktopVirtualizationDayOfWeek.Thursday, DesktopVirtualizationDayOfWeek.Friday }, new ScalingActionTime(6, 0), new ScalingActionTime(8, 0), new ScalingActionTime(18, 0), new ScalingActionTime(20, 0)) { - DaysOfWeek = { DesktopVirtualizationDayOfWeek.Monday, DesktopVirtualizationDayOfWeek.Tuesday, DesktopVirtualizationDayOfWeek.Wednesday, DesktopVirtualizationDayOfWeek.Thursday, DesktopVirtualizationDayOfWeek.Friday }, - RampUpStartTime = new ScalingActionTime(6, 0), RampUpAutoStartHosts = StartupBehavior.All, RampUpStartVmOnConnect = SetStartVmOnConnect.Enable, RampUpActionOnDisconnect = SessionHandlingOperation.None, RampUpMinutesToWaitOnDisconnect = 10, RampUpActionOnLogoff = SessionHandlingOperation.None, RampUpMinutesToWaitOnLogoff = 10, - PeakStartTime = new ScalingActionTime(8, 0), PeakStartVmOnConnect = SetStartVmOnConnect.Enable, PeakActionOnDisconnect = SessionHandlingOperation.None, PeakMinutesToWaitOnDisconnect = 10, PeakActionOnLogoff = SessionHandlingOperation.Deallocate, PeakMinutesToWaitOnLogoff = 10, - RampDownStartTime = new ScalingActionTime(18, 0), RampDownStartVmOnConnect = SetStartVmOnConnect.Enable, RampDownActionOnDisconnect = SessionHandlingOperation.None, RampDownMinutesToWaitOnDisconnect = 10, RampDownActionOnLogoff = SessionHandlingOperation.Deallocate, RampDownMinutesToWaitOnLogoff = 10, - OffPeakStartTime = new ScalingActionTime(20, 0), OffPeakStartVmOnConnect = SetStartVmOnConnect.Enable, OffPeakActionOnDisconnect = SessionHandlingOperation.None, OffPeakMinutesToWaitOnDisconnect = 10, @@ -84,7 +79,7 @@ public async Task CreateOrUpdate_ScalingPlanPersonalSchedulesCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ScalingPlanPersonalSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Get.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +113,7 @@ public async Task Get_ScalingPlanPersonalSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ScalingPlanPersonalSchedulesList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_List.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -157,7 +152,7 @@ public async Task GetAll_ScalingPlanPersonalSchedulesList() [Ignore("Only validating compilation of examples")] public async Task Exists_ScalingPlanPersonalSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Get.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +182,7 @@ public async Task Exists_ScalingPlanPersonalSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ScalingPlanPersonalSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Get.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs index 62750d78eb51..62f829bb1cb1 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPersonalScheduleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ScalingPlanPersonalScheduleResource [Ignore("Only validating compilation of examples")] public async Task Get_ScalingPlanPersonalSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Get.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ScalingPlanPersonalSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ScalingPlanPersonalSchedulesDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Delete.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ScalingPlanPersonalSchedulesDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ScalingPlanPersonalSchedulesUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Update.json // this example is just showing the usage of "ScalingPlanPersonalSchedules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs index b69462e6ec46..575cc7885004 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ScalingPlanPooledScheduleCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ScalingPlanPooledSchedulesCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Create.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -41,23 +41,23 @@ public async Task CreateOrUpdate_ScalingPlanPooledSchedulesCreate() // invoke the operation string scalingPlanScheduleName = "scalingPlanScheduleWeekdays1"; - ScalingPlanPooledScheduleData data = new ScalingPlanPooledScheduleData + ScalingPlanPooledScheduleData data = new ScalingPlanPooledScheduleData( + new DesktopVirtualizationDayOfWeek[] { DesktopVirtualizationDayOfWeek.Monday, DesktopVirtualizationDayOfWeek.Tuesday, DesktopVirtualizationDayOfWeek.Wednesday, DesktopVirtualizationDayOfWeek.Thursday, DesktopVirtualizationDayOfWeek.Friday }, + new ScalingActionTime(6, 0), + 80, + new ScalingActionTime(8, 0), + new ScalingActionTime(18, 0), + 50, + new ScalingActionTime(20, 0)) { - DaysOfWeek = { DesktopVirtualizationDayOfWeek.Monday, DesktopVirtualizationDayOfWeek.Tuesday, DesktopVirtualizationDayOfWeek.Wednesday, DesktopVirtualizationDayOfWeek.Thursday, DesktopVirtualizationDayOfWeek.Friday }, - RampUpStartTime = new ScalingActionTime(6, 0), RampUpLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.DepthFirst, RampUpMinimumHostsPct = 20, - RampUpCapacityThresholdPct = 80, - PeakStartTime = new ScalingActionTime(8, 0), PeakLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.BreadthFirst, - RampDownStartTime = new ScalingActionTime(18, 0), RampDownLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.DepthFirst, RampDownMinimumHostsPct = 20, - RampDownCapacityThresholdPct = 50, RampDownForceLogoffUsers = true, RampDownWaitTimeMinutes = 30, RampDownNotificationMessage = "message", - OffPeakStartTime = new ScalingActionTime(20, 0), OffPeakLoadBalancingAlgorithm = SessionHostLoadBalancingAlgorithm.DepthFirst, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, scalingPlanScheduleName, data); @@ -74,7 +74,7 @@ public async Task CreateOrUpdate_ScalingPlanPooledSchedulesCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Get_ScalingPlanPooledSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ScalingPlanPooledSchedulesList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_List.json // this example is just showing the usage of "ScalingPlanPooledSchedules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +147,7 @@ public async Task GetAll_ScalingPlanPooledSchedulesList() [Ignore("Only validating compilation of examples")] public async Task Exists_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task Exists_ScalingPlanPooledSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs index 33271d157fc8..32c49d6d65a7 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanPooledScheduleResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ScalingPlanPooledScheduleResource [Ignore("Only validating compilation of examples")] public async Task Get_ScalingPlanPooledSchedulesGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Get.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ScalingPlanPooledSchedulesGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ScalingPlanPooledSchedulesDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Delete.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ScalingPlanPooledSchedulesDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ScalingPlanPooledSchedulesUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Update.json // this example is just showing the usage of "ScalingPlanPooledSchedules_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs index 92fa800f4d5e..13546dcd57da 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_ScalingPlanResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ScalingPlanResource [Ignore("Only validating compilation of examples")] public async Task Get_ScalingPlansGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Get.json // this example is just showing the usage of "ScalingPlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_ScalingPlansGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ScalingPlansDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Delete.json // this example is just showing the usage of "ScalingPlans_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_ScalingPlansDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ScalingPlansUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Update.json // this example is just showing the usage of "ScalingPlans_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs index b2d6cb8397bd..13c5c2acad3c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_SessionHostCollection [Ignore("Only validating compilation of examples")] public async Task Get_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_SessionHostGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_SessionHostList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_List.json // this example is just showing the usage of "SessionHosts_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task GetAll_SessionHostList() [Ignore("Only validating compilation of examples")] public async Task Exists_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_SessionHostGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostConfigurationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostConfigurationResource.cs new file mode 100644 index 000000000000..8e0b33956a55 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostConfigurationResource.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DesktopVirtualization.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_SessionHostConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SessionHostConfigurationsGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_Get.json + // this example is just showing the usage of "SessionHostConfigurations_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostConfigurationResource created on azure + // for more information of creating SessionHostConfigurationResource, please refer to the document of SessionHostConfigurationResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostConfigurationResourceId = SessionHostConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostConfigurationResource sessionHostConfiguration = client.GetSessionHostConfigurationResource(sessionHostConfigurationResourceId); + + // invoke the operation + SessionHostConfigurationResource result = await sessionHostConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SessionHostConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SessionHostConfigurationsUpdate() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_Update.json + // this example is just showing the usage of "SessionHostConfigurations_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostConfigurationResource created on azure + // for more information of creating SessionHostConfigurationResource, please refer to the document of SessionHostConfigurationResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostConfigurationResourceId = SessionHostConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostConfigurationResource sessionHostConfiguration = client.GetSessionHostConfigurationResource(sessionHostConfigurationResourceId); + + // invoke the operation + SessionHostConfigurationPatch patch = new SessionHostConfigurationPatch + { + FriendlyName = "Second Version, Updated Location", + VmTags = +{ +["Department"] = "myDepartment", +["Team"] = "myTeam" +}, + VmLocation = "eastus2", + VmResourceGroup = "myResourceGroup", + VmNamePrefix = "westus2-vm", + AvailabilityZones = { 1, 3 }, + NetworkInfo = new NetworkInfoPatchProperties + { + SubnetId = new ResourceIdentifier("/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1"), + SecurityGroupId = "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1", + }, + VmSizeId = "Standard_D2s_v3", + VirtualMachineDiskType = VirtualMachineDiskType.StandardLRS, + CustomConfigurationScriptUri = new Uri("https://storageaccountname.blob.core.windows.net/blobcontainer/file"), + ImageInfo = new ImageInfoPatchProperties + { + ImageType = Models.Type.Marketplace, + MarketplaceInfo = new MarketplaceInfoPatchProperties + { + Offer = "Windows-10", + Publisher = "MicrosoftWindowsDesktop", + Sku = "19h2-ent", + ExactVersion = "2019.0.20190115", + }, + CustomInfoResourceId = new ResourceIdentifier("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"), + }, + ActiveDirectoryInfoDomainCredentials = new KeyVaultCredentialsPatchProperties + { + UsernameKeyVaultSecretUri = new Uri("https://myvault.vault.azure.net/secrets/myusername"), + PasswordKeyVaultSecretUri = new Uri("https://myvault.vault.azure.net/secrets/mysecretname"), + }, + SecurityInfo = new SecurityInfoPatchProperties + { + VirtualMachineSecurityType = VirtualMachineSecurityType.TrustedLaunch, + SecureBootEnabled = true, + VTpmEnabled = true, + }, + VmAdminCredentials = new KeyVaultCredentialsPatchProperties + { + UsernameKeyVaultSecretUri = new Uri("https://myvault.vault.azure.net/secrets/myusername"), + PasswordKeyVaultSecretUri = new Uri("https://myvault.vault.azure.net/secrets/mysecretname"), + }, + BootDiagnosticsInfo = new BootDiagnosticsInfoPatchProperties + { + Enabled = true, + StorageUri = new Uri("https://myStorageAccountName.blob.core.windows.net"), + }, + }; + ArmOperation lro = await sessionHostConfiguration.UpdateAsync(WaitUntil.Completed, patch); + SessionHostConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SessionHostConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SessionHostConfigurationsCreate() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_Create.json + // this example is just showing the usage of "SessionHostConfigurations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostConfigurationResource created on azure + // for more information of creating SessionHostConfigurationResource, please refer to the document of SessionHostConfigurationResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostConfigurationResourceId = SessionHostConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostConfigurationResource sessionHostConfiguration = client.GetSessionHostConfigurationResource(sessionHostConfigurationResourceId); + + // invoke the operation + SessionHostConfigurationData data = new SessionHostConfigurationData( + "westus2-vm", + new NetworkInfoProperties(new ResourceIdentifier("/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1")) + { + SecurityGroupId = "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1", + }, + "Standard_D2s_v3", + new DiskInfoProperties(VirtualMachineDiskType.StandardLRS), + new ImageInfoProperties(Models.Type.Marketplace) + { + MarketplaceInfo = new MarketplaceInfoProperties("Windows-10", "MicrosoftWindowsDesktop", "19h2-ent", "2019.0.20190115"), + CustomInfoResourceId = new ResourceIdentifier("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"), + }, + new DomainInfoProperties(DomainJoinType.ActiveDirectory) + { + ActiveDirectoryInfo = new ActiveDirectoryInfoProperties(new KeyVaultCredentialsProperties(new Uri("https://myvault.vault.azure.net/secrets/myusername"), new Uri("https://myvault.vault.azure.net/secrets/mysecretname")), "OU=testOU,DC=domain,DC=Domain,DC=com") + { + DomainName = "wvdarmtest1.net", + }, + AzureActiveDirectoryInfoMdmProviderGuid = "bdefabc0-95b4-48b3-b645-8a753a63c4fa", + }, + new KeyVaultCredentialsProperties(new Uri("https://myvault.vault.azure.net/secrets/myusername"), new Uri("https://myvault.vault.azure.net/secrets/mysecretname"))) + { + FriendlyName = "InitialConfiguration", + VmTags = +{ +["Department"] = "myDepartment", +["Team"] = "myTeam" +}, + VmLocation = "eastus2", + VmResourceGroup = "myResourceGroup", + AvailabilityZones = { 1, 3 }, + CustomConfigurationScriptUri = new Uri("https://storageaccountname.blob.core.windows.net/blobcontainer/file"), + SecurityInfo = new SecurityInfoProperties + { + VirtualMachineSecurityType = VirtualMachineSecurityType.TrustedLaunch, + SecureBootEnabled = true, + VTpmEnabled = true, + }, + BootDiagnosticsInfo = new BootDiagnosticsInfoProperties + { + Enabled = true, + StorageUri = new Uri("https://myStorageAccountName.blob.core.windows.net"), + }, + }; + ArmOperation lro = await sessionHostConfiguration.CreateOrUpdateAsync(WaitUntil.Completed, data); + SessionHostConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SessionHostConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostManagementResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostManagementResource.cs new file mode 100644 index 000000000000..bd4d748b71de --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostManagementResource.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DesktopVirtualization.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DesktopVirtualization.Samples +{ + public partial class Sample_SessionHostManagementResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SessionHostManagementsGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_Get.json + // this example is just showing the usage of "SessionHostManagements_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostManagementResource created on azure + // for more information of creating SessionHostManagementResource, please refer to the document of SessionHostManagementResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostManagementResourceId = SessionHostManagementResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostManagementResource sessionHostManagement = client.GetSessionHostManagementResource(sessionHostManagementResourceId); + + // invoke the operation + SessionHostManagementResource result = await sessionHostManagement.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SessionHostManagementData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SessionHostManagementsUpdate() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_Update.json + // this example is just showing the usage of "SessionHostManagements_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostManagementResource created on azure + // for more information of creating SessionHostManagementResource, please refer to the document of SessionHostManagementResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostManagementResourceId = SessionHostManagementResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostManagementResource sessionHostManagement = client.GetSessionHostManagementResource(sessionHostManagementResourceId); + + // invoke the operation + SessionHostManagementPatch patch = new SessionHostManagementPatch + { + ScheduledDateTimeZone = "Alaskan Standard Time", + Update = new HostPoolUpdateConfigurationPatchProperties + { + DeleteOriginalVm = true, + MaxVmsRemoved = 4, + LogOffDelayMinutes = 10, + LogOffMessage = "logging off for hostpool update", + }, + }; + SessionHostManagementResource result = await sessionHostManagement.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SessionHostManagementData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SessionHostManagementsCreate() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_Create.json + // this example is just showing the usage of "SessionHostManagements_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostManagementResource created on azure + // for more information of creating SessionHostManagementResource, please refer to the document of SessionHostManagementResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostManagementResourceId = SessionHostManagementResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostManagementResource sessionHostManagement = client.GetSessionHostManagementResource(sessionHostManagementResourceId); + + // invoke the operation + SessionHostManagementData data = new SessionHostManagementData("Alaskan Standard Time", new HostPoolUpdateConfigurationProperties(4, 10) + { + DeleteOriginalVm = true, + LogOffMessage = "logging off for hostpool update", + }); + ArmOperation lro = await sessionHostManagement.CreateOrUpdateAsync(WaitUntil.Completed, data); + SessionHostManagementResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SessionHostManagementData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostInitiateSessionHostUpdate_HostPoolsUpdatePost() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_UpdateSessionHosts_Post.json + // this example is just showing the usage of "InitiateSessionHostUpdate_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostManagementResource created on azure + // for more information of creating SessionHostManagementResource, please refer to the document of SessionHostManagementResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostManagementResourceId = SessionHostManagementResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostManagementResource sessionHostManagement = client.GetSessionHostManagementResource(sessionHostManagementResourceId); + + // invoke the operation + UpdateSessionHostsRequestBody updateSessionHostsRequestBody = new UpdateSessionHostsRequestBody + { + ScheduledOn = DateTimeOffset.Parse("2008-09-22T14:01:54.9571247Z"), + ScheduledDateTimeZone = "Alaskan Standard Time", + Update = new HostPoolUpdateConfigurationPatchProperties + { + DeleteOriginalVm = true, + MaxVmsRemoved = 4, + LogOffDelayMinutes = 10, + LogOffMessage = "logging off for hostpool update", + }, + }; + await sessionHostManagement.PostInitiateSessionHostUpdateAsync(updateSessionHostsRequestBody: updateSessionHostsRequestBody); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostControlSessionHostUpdate_SessionHostManagementsControlUpdatePost() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_ControlSessionHostUpdate_Post.json + // this example is just showing the usage of "ControlSessionHostUpdate_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostManagementResource created on azure + // for more information of creating SessionHostManagementResource, please refer to the document of SessionHostManagementResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostManagementResourceId = SessionHostManagementResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostManagementResource sessionHostManagement = client.GetSessionHostManagementResource(sessionHostManagementResourceId); + + // invoke the operation + HostPoolUpdateControlParameter hostPoolUpdateControlParameter = new HostPoolUpdateControlParameter(HostPoolUpdateAction.Start) + { + CancelMessage = "Host pool update started", + }; + await sessionHostManagement.PostControlSessionHostUpdateAsync(WaitUntil.Completed, hostPoolUpdateControlParameter); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSessionHostManagementsUpdateStatu_SessionHostManagementsUpdateStatusGet() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_UpdateStatus_Get.json + // this example is just showing the usage of "SessionHostManagementsUpdateStatus_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostManagementResource created on azure + // for more information of creating SessionHostManagementResource, please refer to the document of SessionHostManagementResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + ResourceIdentifier sessionHostManagementResourceId = SessionHostManagementResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName); + SessionHostManagementResource sessionHostManagement = client.GetSessionHostManagementResource(sessionHostManagementResourceId); + + // invoke the operation + SessionHostManagementUpdateStatus result = await sessionHostManagement.GetSessionHostManagementsUpdateStatuAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs index dc951de52446..ed310b9c86dd 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SessionHostResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SessionHostResource [Ignore("Only validating compilation of examples")] public async Task Get_SessionHostGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Get.json // this example is just showing the usage of "SessionHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_SessionHostGet() [Ignore("Only validating compilation of examples")] public async Task Delete_SessionHostDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Delete.json // this example is just showing the usage of "SessionHosts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task Delete_SessionHostDelete() [Ignore("Only validating compilation of examples")] public async Task Update_SessionHostUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Update.json // this example is just showing the usage of "SessionHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -112,5 +112,32 @@ public async Task Update_SessionHostUpdate() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RetryProvisioningSessionHost_SessionHostRetryProvisioningPost() + { + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_RetryProvisioning_Post.json + // this example is just showing the usage of "SessionHost_RetryProvisioning" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SessionHostResource created on azure + // for more information of creating SessionHostResource, please refer to the document of SessionHostResource + string subscriptionId = "daefabc0-95b4-48b3-b645-8a753a63c4fa"; + string resourceGroupName = "resourceGroup1"; + string hostPoolName = "hostPool1"; + string sessionHostName = "sessionHost1.microsoft.com"; + ResourceIdentifier sessionHostResourceId = SessionHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, hostPoolName, sessionHostName); + SessionHostResource sessionHost = client.GetSessionHostResource(sessionHostResourceId); + + // invoke the operation + await sessionHost.RetryProvisioningSessionHostAsync(); + + Console.WriteLine("Succeeded"); + } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index c6ad0227ebe6..4dd4de7e0275 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetVirtualWorkspaces_WorkspaceListBySubscription() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_ListBySubscription.json // this example is just showing the usage of "Workspaces_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task GetVirtualWorkspaces_WorkspaceListBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetScalingPlans_ScalingPlansListBySubscription() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_ListBySubscription.json // this example is just showing the usage of "ScalingPlans_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,7 +85,7 @@ public async Task GetScalingPlans_ScalingPlansListBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetVirtualApplicationGroups_ApplicationGroupList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_ListBySubscription.json // this example is just showing the usage of "ApplicationGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task GetVirtualApplicationGroups_ApplicationGroupList() [Ignore("Only validating compilation of examples")] public async Task GetHostPools_HostPoolList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_List.json // this example is just showing the usage of "HostPools_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task GetHostPools_HostPoolList() [Ignore("Only validating compilation of examples")] public async Task GetAppAttachPackages_AppAttachPackageListBySubscription() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_ListBySubscription.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_ListBySubscription.json // this example is just showing the usage of "AppAttachPackage_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs index 32d5e11c7f8c..5f62ad312173 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_UserSessionCollection [Ignore("Only validating compilation of examples")] public async Task Get_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_UserSessionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_UserSessionList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_List.json // this example is just showing the usage of "UserSessions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task GetAll_UserSessionList() [Ignore("Only validating compilation of examples")] public async Task Exists_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_UserSessionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs index 0efe289e2d54..8eb24c61191a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_UserSessionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_UserSessionResource [Ignore("Only validating compilation of examples")] public async Task Get_UserSessionGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Get.json // this example is just showing the usage of "UserSessions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_UserSessionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_UserSessionDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Delete.json // this example is just showing the usage of "UserSessions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Delete_UserSessionDelete() [Ignore("Only validating compilation of examples")] public async Task Disconnect_UserSessionDisconnectPost() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Disconnect_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Disconnect_Post.json // this example is just showing the usage of "UserSessions_Disconnect" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -109,7 +109,7 @@ public async Task Disconnect_UserSessionDisconnectPost() [Ignore("Only validating compilation of examples")] public async Task SendMessage_UserSessionSendMessagePost() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_SendMessage_Post.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_SendMessage_Post.json // this example is just showing the usage of "UserSessions_SendMessage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs index 719d7db7a212..91c1d5be43e2 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualApplicationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApplicationCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Create.json // this example is just showing the usage of "Applications_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_ApplicationCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_ApplicationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ApplicationsList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_List.json // this example is just showing the usage of "Applications_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_ApplicationsList() [Ignore("Only validating compilation of examples")] public async Task Exists_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Exists_ApplicationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs index 9cdccdbefedb..3ea59d8dab16 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualApplicationGroupCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ApplicationGroupCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Create.json // this example is just showing the usage of "ApplicationGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_ApplicationGroupCreate() [Ignore("Only validating compilation of examples")] public async Task Get_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_ApplicationGroupGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ApplicationGroupListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_ListByResourceGroup.json // this example is just showing the usage of "ApplicationGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task GetAll_ApplicationGroupListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task Exists_ApplicationGroupGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs index a2314ed198a9..9a6817b4bbc9 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationGroupResource.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualApplicationGroupResource [Ignore("Only validating compilation of examples")] public async Task Get_ApplicationGroupGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Get.json // this example is just showing the usage of "ApplicationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_ApplicationGroupGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ApplicationGroupDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Delete.json // this example is just showing the usage of "ApplicationGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_ApplicationGroupDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ApplicationGroupsUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Update.json // this example is just showing the usage of "ApplicationGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Update_ApplicationGroupsUpdate() [Ignore("Only validating compilation of examples")] public async Task GetStartMenuItems_StartMenuItemList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/StartMenuItem_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/StartMenuItem_List.json // this example is just showing the usage of "StartMenuItems_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs index fcf93c07ee81..ffe063672dfd 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualApplicationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualApplicationResource [Ignore("Only validating compilation of examples")] public async Task Get_ApplicationGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Get.json // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_ApplicationGet() [Ignore("Only validating compilation of examples")] public async Task Delete_ApplicationDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Delete.json // this example is just showing the usage of "Applications_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_ApplicationDelete() [Ignore("Only validating compilation of examples")] public async Task Update_ApplicationUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Update.json // this example is just showing the usage of "Applications_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs index 530d4064a0fb..ef2a92ba3068 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_VirtualDesktopCollection [Ignore("Only validating compilation of examples")] public async Task Get_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_DesktopGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_DesktopList() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_List.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_List.json // this example is just showing the usage of "Desktops_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task GetAll_DesktopList() [Ignore("Only validating compilation of examples")] public async Task Exists_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_DesktopGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs index 872fc689d260..fce97de32854 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualDesktopResource.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualDesktopResource [Ignore("Only validating compilation of examples")] public async Task Get_DesktopGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Get.json // this example is just showing the usage of "Desktops_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_DesktopGet() [Ignore("Only validating compilation of examples")] public async Task Update_DesktopUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Update.json // this example is just showing the usage of "Desktops_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs index c20e2eb44495..12b9ecdc1cce 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualWorkspaceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_WorkspaceCreate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Create.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Create.json // this example is just showing the usage of "Workspaces_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_WorkspaceCreate() [Ignore("Only validating compilation of examples")] public async Task Get_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Get_WorkspaceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_WorkspaceListByResourceGroup() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_ListByResourceGroup.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_ListByResourceGroup.json // this example is just showing the usage of "Workspaces_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetAll_WorkspaceListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_WorkspaceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs index ae383e2f68d5..b94cc31d2a52 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_VirtualWorkspaceResource.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualWorkspaceResource [Ignore("Only validating compilation of examples")] public async Task Get_WorkspaceGet() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Get.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Get.json // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_WorkspaceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_WorkspaceDelete() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Delete.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Delete.json // this example is just showing the usage of "Workspaces_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Delete_WorkspaceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_WorkspaceUpdate() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Update.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Update.json // this example is just showing the usage of "Workspaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Update_WorkspaceUpdate() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResources_PrivateLinkResourcesListByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateLinkResources_ListByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateLinkResources_ListByWorkspace.json // this example is just showing the usage of "PrivateLinkResources_ListByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs index 96f29b953ae2..f38752fc933a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_WorkspacePrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionUpdateByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_UpdateByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_UpdateByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_UpdateByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionUpdateByWorkspace() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGetByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task Get_PrivateEndpointConnectionGetByWorkspace() [Ignore("Only validating compilation of examples")] public async Task GetAll_PrivateEndpointConnectionListByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_ListByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_ListByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_ListByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task GetAll_PrivateEndpointConnectionListByWorkspace() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGetByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Exists_PrivateEndpointConnectionGetByWorkspace() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGetByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs index 909f4e397b46..bbc7af57a805 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/samples/Generated/Samples/Sample_WorkspacePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_WorkspacePrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGetByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_GetByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGetByWorkspace() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionDeleteByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_DeleteByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_DeleteByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task Delete_PrivateEndpointConnectionDeleteByWorkspace() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionUpdateByWorkspace() { - // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_UpdateByWorkspace.json + // Generated from example definition: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_UpdateByWorkspace.json // this example is just showing the usage of "PrivateEndpointConnections_UpdateByWorkspace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationData.Serialization.cs new file mode 100644 index 000000000000..4191a77930ac --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationData.Serialization.cs @@ -0,0 +1,761 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class ActiveSessionHostConfigurationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version.Value, "O"); + } + if (Optional.IsDefined(FriendlyName)) + { + writer.WritePropertyName("friendlyName"u8); + writer.WriteStringValue(FriendlyName); + } + if (Optional.IsCollectionDefined(VmTags)) + { + writer.WritePropertyName("vmTags"u8); + writer.WriteStartObject(); + foreach (var item in VmTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(VmLocation)) + { + writer.WritePropertyName("vmLocation"u8); + writer.WriteStringValue(VmLocation); + } + if (Optional.IsDefined(VmResourceGroup)) + { + writer.WritePropertyName("vmResourceGroup"u8); + writer.WriteStringValue(VmResourceGroup); + } + writer.WritePropertyName("vmNamePrefix"u8); + writer.WriteStringValue(VmNamePrefix); + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + writer.WritePropertyName("availabilityZones"u8); + writer.WriteStartArray(); + foreach (var item in AvailabilityZones) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("networkInfo"u8); + writer.WriteObjectValue(NetworkInfo, options); + writer.WritePropertyName("vmSizeId"u8); + writer.WriteStringValue(VmSizeId); + writer.WritePropertyName("diskInfo"u8); + writer.WriteObjectValue(DiskInfo, options); + if (Optional.IsDefined(CustomConfigurationScriptUri)) + { + writer.WritePropertyName("customConfigurationScriptUrl"u8); + writer.WriteStringValue(CustomConfigurationScriptUri.AbsoluteUri); + } + writer.WritePropertyName("imageInfo"u8); + writer.WriteObjectValue(ImageInfo, options); + writer.WritePropertyName("domainInfo"u8); + writer.WriteObjectValue(DomainInfo, options); + if (Optional.IsDefined(SecurityInfo)) + { + writer.WritePropertyName("securityInfo"u8); + writer.WriteObjectValue(SecurityInfo, options); + } + writer.WritePropertyName("vmAdminCredentials"u8); + writer.WriteObjectValue(VmAdminCredentials, options); + if (Optional.IsDefined(BootDiagnosticsInfo)) + { + writer.WritePropertyName("bootDiagnosticsInfo"u8); + writer.WriteObjectValue(BootDiagnosticsInfo, options); + } + writer.WriteEndObject(); + } + + ActiveSessionHostConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActiveSessionHostConfigurationData(document.RootElement, options); + } + + internal static ActiveSessionHostConfigurationData DeserializeActiveSessionHostConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + DateTimeOffset? version = default; + string friendlyName = default; + IDictionary vmTags = default; + string vmLocation = default; + string vmResourceGroup = default; + string vmNamePrefix = default; + IList availabilityZones = default; + NetworkInfoProperties networkInfo = default; + string vmSizeId = default; + DiskInfoProperties diskInfo = default; + Uri customConfigurationScriptUrl = default; + ImageInfoProperties imageInfo = default; + DomainInfoProperties domainInfo = default; + SecurityInfoProperties securityInfo = default; + KeyVaultCredentialsProperties vmAdminCredentials = default; + BootDiagnosticsInfoProperties bootDiagnosticsInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("version"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("friendlyName"u8)) + { + friendlyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmTags"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + vmTags = dictionary; + continue; + } + if (property0.NameEquals("vmLocation"u8)) + { + vmLocation = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmResourceGroup"u8)) + { + vmResourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmNamePrefix"u8)) + { + vmNamePrefix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("availabilityZones"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + availabilityZones = array; + continue; + } + if (property0.NameEquals("networkInfo"u8)) + { + networkInfo = NetworkInfoProperties.DeserializeNetworkInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("vmSizeId"u8)) + { + vmSizeId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("diskInfo"u8)) + { + diskInfo = DiskInfoProperties.DeserializeDiskInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("customConfigurationScriptUrl"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customConfigurationScriptUrl = new Uri(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("imageInfo"u8)) + { + imageInfo = ImageInfoProperties.DeserializeImageInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("domainInfo"u8)) + { + domainInfo = DomainInfoProperties.DeserializeDomainInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("securityInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityInfo = SecurityInfoProperties.DeserializeSecurityInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("vmAdminCredentials"u8)) + { + vmAdminCredentials = KeyVaultCredentialsProperties.DeserializeKeyVaultCredentialsProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("bootDiagnosticsInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootDiagnosticsInfo = BootDiagnosticsInfoProperties.DeserializeBootDiagnosticsInfoProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActiveSessionHostConfigurationData( + id, + name, + type, + systemData, + version, + friendlyName, + vmTags ?? new ChangeTrackingDictionary(), + vmLocation, + vmResourceGroup, + vmNamePrefix, + availabilityZones ?? new ChangeTrackingList(), + networkInfo, + vmSizeId, + diskInfo, + customConfigurationScriptUrl, + imageInfo, + domainInfo, + securityInfo, + vmAdminCredentials, + bootDiagnosticsInfo, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Version), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" version: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Version)) + { + builder.Append(" version: "); + var formattedDateTimeString = TypeFormatters.ToString(Version.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FriendlyName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" friendlyName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FriendlyName)) + { + builder.Append(" friendlyName: "); + if (FriendlyName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FriendlyName}'''"); + } + else + { + builder.AppendLine($"'{FriendlyName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmTags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmTags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(VmTags)) + { + if (VmTags.Any()) + { + builder.Append(" vmTags: "); + builder.AppendLine("{"); + foreach (var item in VmTags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmLocation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmLocation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmLocation)) + { + builder.Append(" vmLocation: "); + if (VmLocation.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmLocation}'''"); + } + else + { + builder.AppendLine($"'{VmLocation}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmResourceGroup), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmResourceGroup: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmResourceGroup)) + { + builder.Append(" vmResourceGroup: "); + if (VmResourceGroup.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmResourceGroup}'''"); + } + else + { + builder.AppendLine($"'{VmResourceGroup}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmNamePrefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmNamePrefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmNamePrefix)) + { + builder.Append(" vmNamePrefix: "); + if (VmNamePrefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmNamePrefix}'''"); + } + else + { + builder.AppendLine($"'{VmNamePrefix}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AvailabilityZones), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" availabilityZones: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + if (AvailabilityZones.Any()) + { + builder.Append(" availabilityZones: "); + builder.AppendLine("["); + foreach (var item in AvailabilityZones) + { + builder.AppendLine($" {item}"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NetworkInfo)) + { + builder.Append(" networkInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, NetworkInfo, options, 4, false, " networkInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmSizeId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmSizeId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmSizeId)) + { + builder.Append(" vmSizeId: "); + if (VmSizeId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmSizeId}'''"); + } + else + { + builder.AppendLine($"'{VmSizeId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("VirtualMachineDiskType", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diskInfo: "); + builder.AppendLine("{"); + builder.AppendLine(" diskInfo: {"); + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DiskInfo)) + { + builder.Append(" diskInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, DiskInfo, options, 4, false, " diskInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomConfigurationScriptUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customConfigurationScriptUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CustomConfigurationScriptUri)) + { + builder.Append(" customConfigurationScriptUrl: "); + builder.AppendLine($"'{CustomConfigurationScriptUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImageInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" imageInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ImageInfo)) + { + builder.Append(" imageInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, ImageInfo, options, 4, false, " imageInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DomainInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" domainInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DomainInfo)) + { + builder.Append(" domainInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, DomainInfo, options, 4, false, " domainInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityInfo)) + { + builder.Append(" securityInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityInfo, options, 4, false, " securityInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmAdminCredentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmAdminCredentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmAdminCredentials)) + { + builder.Append(" vmAdminCredentials: "); + BicepSerializationHelpers.AppendChildObject(builder, VmAdminCredentials, options, 4, false, " vmAdminCredentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BootDiagnosticsInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" bootDiagnosticsInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BootDiagnosticsInfo)) + { + builder.Append(" bootDiagnosticsInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, BootDiagnosticsInfo, options, 4, false, " bootDiagnosticsInfo: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationData)} does not support writing '{options.Format}' format."); + } + } + + ActiveSessionHostConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActiveSessionHostConfigurationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationData.cs new file mode 100644 index 000000000000..9983f1806581 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationData.cs @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing the ActiveSessionHostConfiguration data model. + /// Represents a ActiveSessionHostConfiguration definition. This has all of the sessionHostConfiguration properties except provisioningState + /// + public partial class ActiveSessionHostConfigurationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prefix that should be associated with session host names. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Local Admin credentials for session hosts. + /// , , , , , or is null. + public ActiveSessionHostConfigurationData(string vmNamePrefix, NetworkInfoProperties networkInfo, string vmSizeId, DiskInfoProperties diskInfo, ImageInfoProperties imageInfo, DomainInfoProperties domainInfo, KeyVaultCredentialsProperties vmAdminCredentials) + { + Argument.AssertNotNull(vmNamePrefix, nameof(vmNamePrefix)); + Argument.AssertNotNull(networkInfo, nameof(networkInfo)); + Argument.AssertNotNull(vmSizeId, nameof(vmSizeId)); + Argument.AssertNotNull(diskInfo, nameof(diskInfo)); + Argument.AssertNotNull(imageInfo, nameof(imageInfo)); + Argument.AssertNotNull(domainInfo, nameof(domainInfo)); + Argument.AssertNotNull(vmAdminCredentials, nameof(vmAdminCredentials)); + + VmTags = new ChangeTrackingDictionary(); + VmNamePrefix = vmNamePrefix; + AvailabilityZones = new ChangeTrackingList(); + NetworkInfo = networkInfo; + VmSizeId = vmSizeId; + DiskInfo = diskInfo; + ImageInfo = imageInfo; + DomainInfo = domainInfo; + VmAdminCredentials = vmAdminCredentials; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The timestamp of the last update. + /// Friendly name to describe this version of the SessionHostConfiguration. + /// Hashtable that lists key/value pair tags to apply to the VMs. + /// The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + /// The prefix that should be associated with session host names. + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Security information. + /// Local Admin credentials for session hosts. + /// Boot Diagnostics information. + /// Keeps track of any properties unknown to the library. + internal ActiveSessionHostConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? version, string friendlyName, IDictionary vmTags, string vmLocation, string vmResourceGroup, string vmNamePrefix, IList availabilityZones, NetworkInfoProperties networkInfo, string vmSizeId, DiskInfoProperties diskInfo, Uri customConfigurationScriptUri, ImageInfoProperties imageInfo, DomainInfoProperties domainInfo, SecurityInfoProperties securityInfo, KeyVaultCredentialsProperties vmAdminCredentials, BootDiagnosticsInfoProperties bootDiagnosticsInfo, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Version = version; + FriendlyName = friendlyName; + VmTags = vmTags; + VmLocation = vmLocation; + VmResourceGroup = vmResourceGroup; + VmNamePrefix = vmNamePrefix; + AvailabilityZones = availabilityZones; + NetworkInfo = networkInfo; + VmSizeId = vmSizeId; + DiskInfo = diskInfo; + CustomConfigurationScriptUri = customConfigurationScriptUri; + ImageInfo = imageInfo; + DomainInfo = domainInfo; + SecurityInfo = securityInfo; + VmAdminCredentials = vmAdminCredentials; + BootDiagnosticsInfo = bootDiagnosticsInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActiveSessionHostConfigurationData() + { + } + + /// The timestamp of the last update. + [WirePath("properties.version")] + public DateTimeOffset? Version { get; } + /// Friendly name to describe this version of the SessionHostConfiguration. + [WirePath("properties.friendlyName")] + public string FriendlyName { get; set; } + /// Hashtable that lists key/value pair tags to apply to the VMs. + [WirePath("properties.vmTags")] + public IDictionary VmTags { get; } + /// The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + [WirePath("properties.vmLocation")] + public string VmLocation { get; set; } + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + [WirePath("properties.vmResourceGroup")] + public string VmResourceGroup { get; set; } + /// The prefix that should be associated with session host names. + [WirePath("properties.vmNamePrefix")] + public string VmNamePrefix { get; set; } + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + [WirePath("properties.availabilityZones")] + public IList AvailabilityZones { get; } + /// Network information. + [WirePath("properties.networkInfo")] + public NetworkInfoProperties NetworkInfo { get; set; } + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + [WirePath("properties.vmSizeId")] + public string VmSizeId { get; set; } + /// Disk information. + internal DiskInfoProperties DiskInfo { get; set; } + /// The disk type used by virtual machine in hostpool session host. + [WirePath("properties.diskInfo.type")] + public VirtualMachineDiskType? VirtualMachineDiskType + { + get => DiskInfo is null ? default(VirtualMachineDiskType?) : DiskInfo.VirtualMachineDiskType; + set + { + DiskInfo = value.HasValue ? new DiskInfoProperties(value.Value) : null; + } + } + + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + [WirePath("properties.customConfigurationScriptUrl")] + public Uri CustomConfigurationScriptUri { get; set; } + /// Image configurations of HostPool. + [WirePath("properties.imageInfo")] + public ImageInfoProperties ImageInfo { get; set; } + /// Domain configurations of session hosts. + [WirePath("properties.domainInfo")] + public DomainInfoProperties DomainInfo { get; set; } + /// Security information. + [WirePath("properties.securityInfo")] + public SecurityInfoProperties SecurityInfo { get; set; } + /// Local Admin credentials for session hosts. + [WirePath("properties.vmAdminCredentials")] + public KeyVaultCredentialsProperties VmAdminCredentials { get; set; } + /// Boot Diagnostics information. + [WirePath("properties.bootDiagnosticsInfo")] + public BootDiagnosticsInfoProperties BootDiagnosticsInfo { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationResource.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationResource.Serialization.cs new file mode 100644 index 000000000000..c95105c78e89 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class ActiveSessionHostConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ActiveSessionHostConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ActiveSessionHostConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationResource.cs new file mode 100644 index 000000000000..9d6a7a38820e --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ActiveSessionHostConfigurationResource.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A Class representing an ActiveSessionHostConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetActiveSessionHostConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetActiveSessionHostConfiguration method. + /// + public partial class ActiveSessionHostConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The hostPoolName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations/default"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _activeSessionHostConfigurationClientDiagnostics; + private readonly ActiveSessionHostConfigurationsRestOperations _activeSessionHostConfigurationRestClient; + private readonly ActiveSessionHostConfigurationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DesktopVirtualization/hostPools/activeSessionHostConfigurations"; + + /// Initializes a new instance of the class for mocking. + protected ActiveSessionHostConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ActiveSessionHostConfigurationResource(ArmClient client, ActiveSessionHostConfigurationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ActiveSessionHostConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _activeSessionHostConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string activeSessionHostConfigurationApiVersion); + _activeSessionHostConfigurationRestClient = new ActiveSessionHostConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, activeSessionHostConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ActiveSessionHostConfigurationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations/default + /// + /// + /// Operation Id + /// ActiveSessionHostConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _activeSessionHostConfigurationClientDiagnostics.CreateScope("ActiveSessionHostConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _activeSessionHostConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ActiveSessionHostConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations/default + /// + /// + /// Operation Id + /// ActiveSessionHostConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _activeSessionHostConfigurationClientDiagnostics.CreateScope("ActiveSessionHostConfigurationResource.Get"); + scope.Start(); + try + { + var response = _activeSessionHostConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ActiveSessionHostConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageCollection.cs index a8a7cee93187..8d3cdcbf9d1f 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -74,7 +74,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// Object containing App Attach Package definitions. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -125,7 +125,7 @@ public virtual async Task> CreateOrUpdate /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// Object containing App Attach Package definitions. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -175,7 +175,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string ap /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -220,7 +220,7 @@ public virtual async Task> GetAsync(string ap /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -257,7 +257,7 @@ public virtual Response Get(string appAttachPackageNam /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual Response Get(string appAttachPackageNam /// /// /// - /// OData filter expression. Valid properties for filtering are package name and host pool. + /// OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) @@ -288,7 +288,7 @@ public virtual AsyncPageable GetAllAsync(string filter /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -296,7 +296,7 @@ public virtual AsyncPageable GetAllAsync(string filter /// /// /// - /// OData filter expression. Valid properties for filtering are package name and host pool. + /// OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) @@ -319,7 +319,7 @@ public virtual Pageable GetAll(string filter = null, C /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -327,7 +327,7 @@ public virtual Pageable GetAll(string filter = null, C /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -362,7 +362,7 @@ public virtual async Task> ExistsAsync(string appAttachPackageNam /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task> ExistsAsync(string appAttachPackageNam /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -405,7 +405,7 @@ public virtual Response Exists(string appAttachPackageName, CancellationTo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -413,7 +413,7 @@ public virtual Response Exists(string appAttachPackageName, CancellationTo /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -450,7 +450,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> GetIfExist /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageResource.cs index 61eb87ae10fa..7e068ebb975e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/AppAttachPackageResource.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Threading.Tasks; @@ -102,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +143,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +183,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -191,15 +192,16 @@ public virtual Response Get(CancellationToken cancella /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Force flag to delete App Attach package. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? force = null, CancellationToken cancellationToken = default) { using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.Delete"); scope.Start(); try { - var response = await _appAttachPackageRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _appAttachPackageRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + var response = await _appAttachPackageRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force, cancellationToken).ConfigureAwait(false); + var uri = _appAttachPackageRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new DesktopVirtualizationArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -226,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -235,15 +237,16 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Force flag to delete App Attach package. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? force = null, CancellationToken cancellationToken = default) { using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.Delete"); scope.Start(); try { - var response = _appAttachPackageRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var uri = _appAttachPackageRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + var response = _appAttachPackageRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force, cancellationToken); + var uri = _appAttachPackageRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, force); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new DesktopVirtualizationArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -270,7 +273,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -312,7 +315,7 @@ public virtual async Task> UpdateAsync(AppAtt /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -340,5 +343,363 @@ public virtual Response Update(AppAttachPackagePatch p throw; } } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName} + /// + /// + /// Operation Id + /// AppAttachPackage_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _appAttachPackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AppAttachPackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AppAttachPackagePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName} + /// + /// + /// Operation Id + /// AppAttachPackage_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _appAttachPackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AppAttachPackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AppAttachPackagePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName} + /// + /// + /// Operation Id + /// AppAttachPackage_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _appAttachPackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AppAttachPackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AppAttachPackagePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName} + /// + /// + /// Operation Id + /// AppAttachPackage_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _appAttachPackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AppAttachPackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AppAttachPackagePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName} + /// + /// + /// Operation Id + /// AppAttachPackage_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _appAttachPackageRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AppAttachPackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new AppAttachPackagePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/appAttachPackages/{appAttachPackageName} + /// + /// + /// Operation Id + /// AppAttachPackage_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _appAttachPackageClientDiagnostics.CreateScope("AppAttachPackageResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _appAttachPackageRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AppAttachPackageResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new AppAttachPackagePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs index 4c176845faa2..719be0c95f53 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ArmDesktopVirtualizationModelFactory.cs @@ -34,9 +34,9 @@ public static partial class ArmDesktopVirtualizationModelFactory /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// A new instance for mocking. public static VirtualWorkspaceData VirtualWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, IEnumerable applicationGroupReferences = null, bool? isCloudPCResource = null, DesktopVirtualizationPublicNetworkAccess? publicNetworkAccess = null, IEnumerable privateEndpointConnections = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { @@ -157,14 +157,14 @@ public static DesktopVirtualizationPrivateLinkResourceData DesktopVirtualization /// Timezone of the scaling plan. /// HostPool type for desktop. /// Exclusion tag for scaling plan. - /// List of ScalingPlanPooledSchedule definitions. + /// List of Pooled ScalingSchedule definitions. /// List of ScalingHostPoolReference definitions. /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// A new instance for mocking. public static ScalingPlanData ScalingPlanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, string timeZone = null, ScalingHostPoolType? scalingHostPoolType = null, string exclusionTag = null, IEnumerable schedules = null, IEnumerable hostPoolReferences = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { @@ -201,6 +201,7 @@ public static ScalingPlanData ScalingPlanData(ResourceIdentifier id = null, stri /// The name. /// The resourceType. /// The systemData. + /// Name of the ScalingPlanPooledSchedule. /// Set of days of the week on which this schedule is active. /// Starting time for ramp up period. /// Load balancing algorithm for ramp up period. @@ -219,7 +220,7 @@ public static ScalingPlanData ScalingPlanData(ResourceIdentifier id = null, stri /// Starting time for off-peak period. /// Load balancing algorithm for off-peak period. /// A new instance for mocking. - public static ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable daysOfWeek = null, ScalingActionTime rampUpStartTime = null, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = null, int? rampUpMinimumHostsPct = null, int? rampUpCapacityThresholdPct = null, ScalingActionTime peakStartTime = null, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = null, ScalingActionTime rampDownStartTime = null, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = null, int? rampDownMinimumHostsPct = null, int? rampDownCapacityThresholdPct = null, bool? rampDownForceLogoffUsers = null, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = null, int? rampDownWaitTimeMinutes = null, string rampDownNotificationMessage = null, ScalingActionTime offPeakStartTime = null, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm = null) + public static ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string namePropertiesName = null, IEnumerable daysOfWeek = null, ScalingActionTime rampUpStartTime = null, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = null, int? rampUpMinimumHostsPct = null, int rampUpCapacityThresholdPct = default, ScalingActionTime peakStartTime = null, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = null, ScalingActionTime rampDownStartTime = null, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = null, int? rampDownMinimumHostsPct = null, int rampDownCapacityThresholdPct = default, bool? rampDownForceLogoffUsers = null, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = null, int? rampDownWaitTimeMinutes = null, string rampDownNotificationMessage = null, ScalingActionTime offPeakStartTime = null, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm = null) { daysOfWeek ??= new List(); @@ -228,6 +229,7 @@ public static ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(Resour name, resourceType, systemData, + namePropertiesName, daysOfWeek?.ToList(), rampUpStartTime, rampUpLoadBalancingAlgorithm, @@ -253,6 +255,7 @@ public static ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(Resour /// The name. /// The resourceType. /// The systemData. + /// Name of the ScalingPlanPooledSchedule. /// Set of days of the week on which this schedule is active. /// Starting time for ramp up period. /// Load balancing algorithm for ramp up period. @@ -271,7 +274,7 @@ public static ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(Resour /// Starting time for off-peak period. /// Load balancing algorithm for off-peak period. /// A new instance for mocking. - public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable daysOfWeek = null, ScalingActionTime rampUpStartTime = null, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = null, int? rampUpMinimumHostsPct = null, int? rampUpCapacityThresholdPct = null, ScalingActionTime peakStartTime = null, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = null, ScalingActionTime rampDownStartTime = null, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = null, int? rampDownMinimumHostsPct = null, int? rampDownCapacityThresholdPct = null, bool? rampDownForceLogoffUsers = null, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = null, int? rampDownWaitTimeMinutes = null, string rampDownNotificationMessage = null, ScalingActionTime offPeakStartTime = null, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm = null) + public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string namePropertiesName = null, IEnumerable daysOfWeek = null, ScalingActionTime rampUpStartTime = null, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = null, int? rampUpMinimumHostsPct = null, int? rampUpCapacityThresholdPct = null, ScalingActionTime peakStartTime = null, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = null, ScalingActionTime rampDownStartTime = null, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = null, int? rampDownMinimumHostsPct = null, int? rampDownCapacityThresholdPct = null, bool? rampDownForceLogoffUsers = null, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = null, int? rampDownWaitTimeMinutes = null, string rampDownNotificationMessage = null, ScalingActionTime offPeakStartTime = null, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm = null) { daysOfWeek ??= new List(); @@ -280,6 +283,7 @@ public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(Reso name, resourceType, systemData, + namePropertiesName, daysOfWeek?.ToList(), rampUpStartTime, rampUpLoadBalancingAlgorithm, @@ -388,9 +392,9 @@ public static ScalingPlanPersonalScheduleData ScalingPlanPersonalScheduleData(Re /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// A new instance for mocking. public static VirtualApplicationGroupData VirtualApplicationGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string description = null, string friendlyName = null, ResourceIdentifier hostPoolId = null, ResourceIdentifier workspaceId = null, VirtualApplicationGroupType applicationGroupType = default, bool? isCloudPCResource = null, bool? showInFeed = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { @@ -559,8 +563,9 @@ public static VirtualDesktopData VirtualDesktopData(ResourceIdentifier id = null /// The type of the load balancer. /// The ring number of HostPool. /// Is validation environment. - /// The registration info of HostPool. + /// The registration info of HostPool. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. /// VM template for sessionhosts configuration within hostpool. + /// The type of management for this hostpool, Automated or Standard. The default value is Automated. /// List of applicationGroup links. /// List of App Attach Package links. /// URL to customer ADFS server for signing WVD SSO certificates. @@ -573,14 +578,18 @@ public static VirtualDesktopData VirtualDesktopData(ResourceIdentifier id = null /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. /// The session host configuration for updating agent, monitoring agent, and stack component. /// List of private endpoint connection associated with the specified resource. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// A new instance for mocking. - public static HostPoolData HostPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string friendlyName = null, string description = null, HostPoolType hostPoolType = default, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, string customRdpProperty = null, int? maxSessionLimit = null, HostPoolLoadBalancerType loadBalancerType = default, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfo registrationInfo = null, string vmTemplate = null, IEnumerable applicationGroupReferences = null, IEnumerable appAttachPackageReferences = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType preferredAppGroupType = default, bool? startVmOnConnect = null, bool? isCloudPCResource = null, HostPoolPublicNetworkAccess? publicNetworkAccess = null, SessionHostAgentUpdateProperties agentUpdate = null, IEnumerable privateEndpointConnections = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) + public static HostPoolData HostPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string objectId = null, string friendlyName = null, string description = null, HostPoolType hostPoolType = default, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, string customRdpProperty = null, int? maxSessionLimit = null, HostPoolLoadBalancerType loadBalancerType = default, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfo registrationInfo = null, string vmTemplate = null, ManagementType? managementType = null, IEnumerable applicationGroupReferences = null, IEnumerable appAttachPackageReferences = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType preferredAppGroupType = default, bool? startVmOnConnect = null, bool? isCloudPCResource = null, HostPoolPublicNetworkAccess? publicNetworkAccess = null, SessionHostAgentUpdateProperties agentUpdate = null, IEnumerable privateEndpointConnections = null, ManagedPrivateUDP? managedPrivateUDP = null, DirectUDP? directUDP = null, PublicUDP? publicUDP = null, RelayUDP? relayUDP = null, ResourceIdentifier managedBy = null, string kind = null, ETag? etag = null, ManagedServiceIdentity identity = null, DesktopVirtualizationSku sku = null, ArmPlan plan = null) { tags ??= new Dictionary(); applicationGroupReferences ??= new List(); @@ -606,6 +615,7 @@ public static HostPoolData HostPoolData(ResourceIdentifier id = null, string nam isValidationEnvironment, registrationInfo, vmTemplate, + managementType, applicationGroupReferences?.ToList(), appAttachPackageReferences?.ToList(), ssoAdfsAuthority, @@ -618,6 +628,10 @@ public static HostPoolData HostPoolData(ResourceIdentifier id = null, string nam publicNetworkAccess, agentUpdate, privateEndpointConnections?.ToList(), + managedPrivateUDP, + directUDP, + publicUDP, + relayUDP, managedBy, kind, etag, @@ -641,7 +655,7 @@ public static HostPoolData HostPoolData(ResourceIdentifier id = null, string nam /// The type of the load balancer. /// The ring number of HostPool. /// Is validation environment. - /// The registration info of HostPool. + /// The registration info of HostPool. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. /// VM template for sessionhosts configuration within hostpool. /// URL to customer ADFS server for signing WVD SSO certificates. /// ClientId for the registered Relying Party used to issue WVD SSO certificates. @@ -651,8 +665,12 @@ public static HostPoolData HostPoolData(ResourceIdentifier id = null, string nam /// The flag to turn on/off StartVMOnConnect feature. /// Enabled to allow this resource to be access from the public network. /// The session host configuration for updating agent, monitoring agent, and stack component. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. /// A new instance for mocking. - public static HostPoolPatch HostPoolPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, string friendlyName = null, string description = null, string customRdpProperty = null, int? maxSessionLimit = null, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, HostPoolLoadBalancerType? loadBalancerType = null, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfoPatch registrationInfo = null, string vmTemplate = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType? preferredAppGroupType = null, bool? startVmOnConnect = null, HostPoolPublicNetworkAccess? publicNetworkAccess = null, SessionHostAgentUpdatePatchProperties agentUpdate = null) + public static HostPoolPatch HostPoolPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, string friendlyName = null, string description = null, string customRdpProperty = null, int? maxSessionLimit = null, PersonalDesktopAssignmentType? personalDesktopAssignmentType = null, HostPoolLoadBalancerType? loadBalancerType = null, int? ring = null, bool? isValidationEnvironment = null, HostPoolRegistrationInfoPatch registrationInfo = null, string vmTemplate = null, string ssoAdfsAuthority = null, string ssoClientId = null, string ssoClientSecretKeyVaultPath = null, HostPoolSsoSecretType? ssoSecretType = null, PreferredAppGroupType? preferredAppGroupType = null, bool? startVmOnConnect = null, HostPoolPublicNetworkAccess? publicNetworkAccess = null, SessionHostAgentUpdatePatchProperties agentUpdate = null, ManagedPrivateUDP? managedPrivateUDP = null, DirectUDP? directUDP = null, PublicUDP? publicUDP = null, RelayUDP? relayUDP = null) { tags ??= new Dictionary(); @@ -680,9 +698,203 @@ public static HostPoolPatch HostPoolPatch(ResourceIdentifier id = null, string n startVmOnConnect, publicNetworkAccess, agentUpdate, + managedPrivateUDP, + directUDP, + publicUDP, + relayUDP, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. + /// Parameters for a hostpool update. + /// A new instance for mocking. + public static SessionHostManagementData SessionHostManagementData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string scheduledDateTimeZone = null, HostPoolUpdateConfigurationProperties update = null) + { + return new SessionHostManagementData( + id, + name, + resourceType, + systemData, + scheduledDateTimeZone, + update, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Action types for controlling hostpool update. + /// The cancel message sent to the user on the session host. This is can only be specified if the action is 'Cancel'. + /// A new instance for mocking. + public static HostPoolUpdateControlParameter HostPoolUpdateControlParameter(HostPoolUpdateAction action = default, string cancelMessage = null) + { + return new HostPoolUpdateControlParameter(action, cancelMessage, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// If present, details of the operation error. + /// The Log Analytics. + /// Progress information on the sessionHostManagement operation. + /// The timestamp that the update is scheduled for. + /// SessionHostManagement properties used for the operation. + /// A new instance for mocking. + public static SessionHostManagementUpdateStatus SessionHostManagementUpdateStatus(string id = null, string name = null, string status = null, float? percentComplete = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, ResponseError error = null, string correlationId = null, SessionHostManagementOperationProgress progress = null, DateTimeOffset? scheduledOn = null, SessionHostManagementData sessionHostManagement = null) + { + return new SessionHostManagementUpdateStatus( + id, + name, + status, + percentComplete, + startOn, + endOn, + error, + correlationId, + progress, + scheduledOn, + sessionHostManagement, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Time that the sessionHostManagement operation was created. + /// The number of sessionHosts to be started in the sessionHostManagement operation. + /// The number of sessionHosts in progress in the sessionHostManagement operation. + /// The number of sessionHosts completed in the sessionHostManagement operation. + /// The number of sessionHosts rollback failed in the sessionHostManagement operation. + /// A new instance for mocking. + public static SessionHostManagementOperationProgress SessionHostManagementOperationProgress(DateTimeOffset? executionStartOn = null, int? totalSessionHosts = null, int? sessionHostsInProgress = null, int? sessionHostsCompleted = null, int? sessionHostsRollbackFailed = null) + { + return new SessionHostManagementOperationProgress( + executionStartOn, + totalSessionHosts, + sessionHostsInProgress, + sessionHostsCompleted, + sessionHostsRollbackFailed, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The timestamp of the last update. + /// Friendly name to describe this version of the SessionHostConfiguration. + /// Provisioning state of the Session Host Configuration. + /// Hashtable that lists key/value pair tags to apply to the VMs. + /// The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + /// The prefix that should be associated with session host names. + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Security information. + /// Local Admin credentials for session hosts. + /// Boot Diagnostics information. + /// A new instance for mocking. + public static SessionHostConfigurationData SessionHostConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? version = null, string friendlyName = null, ProvisioningStateSHC? provisioningState = null, IDictionary vmTags = null, string vmLocation = null, string vmResourceGroup = null, string vmNamePrefix = null, IEnumerable availabilityZones = null, NetworkInfoProperties networkInfo = null, string vmSizeId = null, VirtualMachineDiskType? virtualMachineDiskType = null, Uri customConfigurationScriptUri = null, ImageInfoProperties imageInfo = null, DomainInfoProperties domainInfo = null, SecurityInfoProperties securityInfo = null, KeyVaultCredentialsProperties vmAdminCredentials = null, BootDiagnosticsInfoProperties bootDiagnosticsInfo = null) + { + vmTags ??= new Dictionary(); + availabilityZones ??= new List(); + + return new SessionHostConfigurationData( + id, + name, + resourceType, + systemData, + version, + friendlyName, + provisioningState, + vmTags, + vmLocation, + vmResourceGroup, + vmNamePrefix, + availabilityZones?.ToList(), + networkInfo, + vmSizeId, + virtualMachineDiskType.HasValue ? new DiskInfoProperties(virtualMachineDiskType.Value, serializedAdditionalRawData: null) : null, + customConfigurationScriptUri, + imageInfo, + domainInfo, + securityInfo, + vmAdminCredentials, + bootDiagnosticsInfo, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The timestamp of the last update. + /// Friendly name to describe this version of the SessionHostConfiguration. + /// Hashtable that lists key/value pair tags to apply to the VMs. + /// The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + /// The prefix that should be associated with session host names. + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Security information. + /// Local Admin credentials for session hosts. + /// Boot Diagnostics information. + /// A new instance for mocking. + public static ActiveSessionHostConfigurationData ActiveSessionHostConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? version = null, string friendlyName = null, IDictionary vmTags = null, string vmLocation = null, string vmResourceGroup = null, string vmNamePrefix = null, IEnumerable availabilityZones = null, NetworkInfoProperties networkInfo = null, string vmSizeId = null, VirtualMachineDiskType? virtualMachineDiskType = null, Uri customConfigurationScriptUri = null, ImageInfoProperties imageInfo = null, DomainInfoProperties domainInfo = null, SecurityInfoProperties securityInfo = null, KeyVaultCredentialsProperties vmAdminCredentials = null, BootDiagnosticsInfoProperties bootDiagnosticsInfo = null) + { + vmTags ??= new Dictionary(); + availabilityZones ??= new List(); + + return new ActiveSessionHostConfigurationData( + id, + name, + resourceType, + systemData, + version, + friendlyName, + vmTags, + vmLocation, + vmResourceGroup, + vmNamePrefix, + availabilityZones?.ToList(), + networkInfo, + vmSizeId, + virtualMachineDiskType.HasValue ? new DiskInfoProperties(virtualMachineDiskType.Value, serializedAdditionalRawData: null) : null, + customConfigurationScriptUri, + imageInfo, + domainInfo, + securityInfo, + vmAdminCredentials, + bootDiagnosticsInfo, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Expiration time of registration token. + /// The registration token base64 encoded string. + /// A new instance for mocking. + public static RegistrationTokenMinimal RegistrationTokenMinimal(DateTimeOffset? expireOn = null, string token = null) + { + return new RegistrationTokenMinimal(expireOn, token, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -732,9 +944,11 @@ public static UserSessionData UserSessionData(ResourceIdentifier id = null, stri /// Update state of a SessionHost. /// The timestamp of the last update. /// The error message. + /// The last time update was completed. + /// SessionHostConfiguration version reference at the time the update is initiated, in the format of date time. Example: 2024-04-26T04:56:45Z. /// List of SessionHostHealthCheckReports. /// A new instance for mocking. - public static SessionHostData SessionHostData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string objectId = null, DateTimeOffset? lastHeartBeatOn = null, int? sessions = null, string agentVersion = null, bool? allowNewSession = null, string vmId = null, ResourceIdentifier resourceId = null, string assignedUser = null, string friendlyName = null, SessionHostStatus? status = null, DateTimeOffset? statusTimestamp = null, string osVersion = null, string sxsStackVersion = null, SessionHostUpdateState? updateState = null, DateTimeOffset? lastUpdatedOn = null, string updateErrorMessage = null, IEnumerable sessionHostHealthCheckResults = null) + public static SessionHostData SessionHostData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string objectId = null, DateTimeOffset? lastHeartBeatOn = null, int? sessions = null, string agentVersion = null, bool? allowNewSession = null, string vmId = null, ResourceIdentifier resourceId = null, string assignedUser = null, string friendlyName = null, SessionHostStatus? status = null, DateTimeOffset? statusTimestamp = null, string osVersion = null, string sxsStackVersion = null, SessionHostUpdateState? updateState = null, DateTimeOffset? lastUpdatedOn = null, string updateErrorMessage = null, DateTimeOffset? lastSessionHostUpdateOn = null, string sessionHostConfiguration = null, IEnumerable sessionHostHealthCheckResults = null) { sessionHostHealthCheckResults ??= new List(); @@ -759,6 +973,8 @@ public static SessionHostData SessionHostData(ResourceIdentifier id = null, stri updateState, lastUpdatedOn, updateErrorMessage, + lastSessionHostUpdateOn, + sessionHostConfiguration, sessionHostHealthCheckResults?.ToList(), serializedAdditionalRawData: null); } @@ -818,7 +1034,7 @@ public static SessionHostPatch SessionHostPatch(ResourceIdentifier id = null, st /// Specifies how to register Package in feed. /// Make this version of the package the active one across the hostpool. /// List of package dependencies. - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. /// Date Package was last updated, found in the appxmanifest.xml. /// List of package applications. /// A new instance for mocking. @@ -896,10 +1112,13 @@ public static AppAttachPackageData AppAttachPackageData(ResourceIdentifier id = /// The provisioning state of the App Attach Package. /// Detailed properties for App Attach Package. /// List of Hostpool resource Ids. - /// URL path to certificate name located in keyVault. + /// URL of keyvault location to store certificate. /// Parameter indicating how the health check should behave if this package fails staging. + /// Specific name of package owner, is "AppAttach" for native app attach packages. + /// Lookback url to third party control plane, is null for native app attach packages. + /// Field that can be populated with custom data and filtered on in list GET calls. /// A new instance for mocking. - public static AppAttachPackageProperties AppAttachPackageProperties(AppAttachPackageProvisioningState? provisioningState = null, AppAttachPackageInfoProperties image = null, IEnumerable hostPoolReferences = null, Uri keyVaultUri = null, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure = null) + public static AppAttachPackageProperties AppAttachPackageProperties(AppAttachPackageProvisioningState? provisioningState = null, AppAttachPackageInfoProperties image = null, IEnumerable hostPoolReferences = null, Uri keyVaultUri = null, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure = null, string packageOwnerName = null, Uri packageLookbackUri = null, string customData = null) { hostPoolReferences ??= new List(); @@ -909,6 +1128,9 @@ public static AppAttachPackageProperties AppAttachPackageProperties(AppAttachPac hostPoolReferences?.ToList(), keyVaultUri, failHealthCheckOnStagingFailure, + packageOwnerName, + packageLookbackUri, + customData, serializedAdditionalRawData: null); } @@ -927,7 +1149,7 @@ public static AppAttachPackageProperties AppAttachPackageProperties(AppAttachPac /// Specifies how to register Package in feed. /// Make this version of the package the active one across the hostpool. /// List of package dependencies. - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. /// Date Package was last updated, found in the appxmanifest.xml. /// List of package applications. /// Certificate name found in the appxmanifest.xml. @@ -966,19 +1188,211 @@ public static ExpandMsixImage ExpandMsixImage(ResourceIdentifier id = null, stri /// The name. /// The resourceType. /// The systemData. + /// tags to be updated. /// Detailed properties for App Attach Package. /// A new instance for mocking. - public static AppAttachPackagePatch AppAttachPackagePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AppAttachPackagePatchProperties properties = null) + public static AppAttachPackagePatch AppAttachPackagePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AppAttachPackagePatchProperties properties = null) { + tags ??= new Dictionary(); + return new AppAttachPackagePatch( id, name, resourceType, systemData, + tags, properties, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Set of days of the week on which this schedule is active. + /// Starting time for ramp up period. + /// Load balancing algorithm for ramp up period. + /// Minimum host percentage for ramp up period. + /// Capacity threshold for ramp up period. + /// Starting time for peak period. + /// Load balancing algorithm for peak period. + /// Starting time for ramp down period. + /// Load balancing algorithm for ramp down period. + /// Minimum host percentage for ramp down period. + /// Capacity threshold for ramp down period. + /// Should users be logged off forcefully from hosts. + /// Specifies when to stop hosts during ramp down period. + /// Number of minutes to wait to stop hosts during ramp down period. + /// Notification message for users during ramp down period. + /// Starting time for off-peak period. + /// Load balancing algorithm for off-peak period. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ScalingPlanPooledScheduleData ScalingPlanPooledScheduleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IEnumerable daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm) + { + return ScalingPlanPooledScheduleData(id: id, name: name, resourceType: resourceType, systemData: systemData, namePropertiesName: default, daysOfWeek: daysOfWeek, rampUpStartTime: rampUpStartTime, rampUpLoadBalancingAlgorithm: rampUpLoadBalancingAlgorithm, rampUpMinimumHostsPct: rampUpMinimumHostsPct, rampUpCapacityThresholdPct: rampUpCapacityThresholdPct, peakStartTime: peakStartTime, peakLoadBalancingAlgorithm: peakLoadBalancingAlgorithm, rampDownStartTime: rampDownStartTime, rampDownLoadBalancingAlgorithm: rampDownLoadBalancingAlgorithm, rampDownMinimumHostsPct: rampDownMinimumHostsPct, rampDownCapacityThresholdPct: rampDownCapacityThresholdPct, rampDownForceLogoffUsers: rampDownForceLogoffUsers, rampDownStopHostsWhen: rampDownStopHostsWhen, rampDownWaitTimeMinutes: rampDownWaitTimeMinutes, rampDownNotificationMessage: rampDownNotificationMessage, offPeakStartTime: offPeakStartTime, offPeakLoadBalancingAlgorithm: offPeakLoadBalancingAlgorithm); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Set of days of the week on which this schedule is active. + /// Starting time for ramp up period. + /// Load balancing algorithm for ramp up period. + /// Minimum host percentage for ramp up period. + /// Capacity threshold for ramp up period. + /// Starting time for peak period. + /// Load balancing algorithm for peak period. + /// Starting time for ramp down period. + /// Load balancing algorithm for ramp down period. + /// Minimum host percentage for ramp down period. + /// Capacity threshold for ramp down period. + /// Should users be logged off forcefully from hosts. + /// Specifies when to stop hosts during ramp down period. + /// Number of minutes to wait to stop hosts during ramp down period. + /// Notification message for users during ramp down period. + /// Starting time for off-peak period. + /// Load balancing algorithm for off-peak period. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ScalingPlanPooledSchedulePatch ScalingPlanPooledSchedulePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IEnumerable daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm) + { + return ScalingPlanPooledSchedulePatch(id: id, name: name, resourceType: resourceType, systemData: systemData, namePropertiesName: default, daysOfWeek: daysOfWeek, rampUpStartTime: rampUpStartTime, rampUpLoadBalancingAlgorithm: rampUpLoadBalancingAlgorithm, rampUpMinimumHostsPct: rampUpMinimumHostsPct, rampUpCapacityThresholdPct: rampUpCapacityThresholdPct, peakStartTime: peakStartTime, peakLoadBalancingAlgorithm: peakLoadBalancingAlgorithm, rampDownStartTime: rampDownStartTime, rampDownLoadBalancingAlgorithm: rampDownLoadBalancingAlgorithm, rampDownMinimumHostsPct: rampDownMinimumHostsPct, rampDownCapacityThresholdPct: rampDownCapacityThresholdPct, rampDownForceLogoffUsers: rampDownForceLogoffUsers, rampDownStopHostsWhen: rampDownStopHostsWhen, rampDownWaitTimeMinutes: rampDownWaitTimeMinutes, rampDownNotificationMessage: rampDownNotificationMessage, offPeakStartTime: offPeakStartTime, offPeakLoadBalancingAlgorithm: offPeakLoadBalancingAlgorithm); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// ObjectId of HostPool. (internal use). + /// Friendly name of HostPool. + /// Description of HostPool. + /// HostPool type for desktop. + /// PersonalDesktopAssignment type for HostPool. + /// Custom rdp property of HostPool. + /// The max session limit of HostPool. + /// The type of the load balancer. + /// The ring number of HostPool. + /// Is validation environment. + /// The registration info of HostPool. + /// VM template for sessionhosts configuration within hostpool. + /// List of applicationGroup links. + /// List of App Attach Package links. + /// URL to customer ADFS server for signing WVD SSO certificates. + /// ClientId for the registered Relying Party used to issue WVD SSO certificates. + /// Path to Azure KeyVault storing the secret used for communication to ADFS. + /// The type of single sign on Secret Type. + /// The type of preferred application group type, default to Desktop Application Group. + /// The flag to turn on/off StartVMOnConnect feature. + /// Is cloud pc resource. + /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. + /// The session host configuration for updating agent, monitoring agent, and stack component. + /// List of private endpoint connection associated with the specified resource. + /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + /// The etag field is *not* required. If it is provided in the response body, it must 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. + /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// The resource model definition representing SKU. + /// Gets or sets the plan. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HostPoolData HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IEnumerable applicationGroupReferences, IEnumerable appAttachPackageReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdateProperties agentUpdate, IEnumerable privateEndpointConnections, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) + { + return HostPoolData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, objectId: objectId, friendlyName: friendlyName, description: description, hostPoolType: hostPoolType, personalDesktopAssignmentType: personalDesktopAssignmentType, customRdpProperty: customRdpProperty, maxSessionLimit: maxSessionLimit, loadBalancerType: loadBalancerType, ring: ring, isValidationEnvironment: isValidationEnvironment, registrationInfo: registrationInfo, vmTemplate: vmTemplate, managementType: default, applicationGroupReferences: applicationGroupReferences, appAttachPackageReferences: appAttachPackageReferences, ssoAdfsAuthority: ssoAdfsAuthority, ssoClientId: ssoClientId, ssoClientSecretKeyVaultPath: ssoClientSecretKeyVaultPath, ssoSecretType: ssoSecretType, preferredAppGroupType: preferredAppGroupType, startVmOnConnect: startVmOnConnect, isCloudPCResource: isCloudPCResource, publicNetworkAccess: publicNetworkAccess, agentUpdate: agentUpdate, privateEndpointConnections: privateEndpointConnections, managedPrivateUDP: default, directUDP: default, publicUDP: default, relayUDP: default, managedBy: managedBy, kind: kind, etag: etag, identity: identity, sku: sku, plan: plan); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// tags to be updated. + /// Friendly name of HostPool. + /// Description of HostPool. + /// Custom rdp property of HostPool. + /// The max session limit of HostPool. + /// PersonalDesktopAssignment type for HostPool. + /// The type of the load balancer. + /// The ring number of HostPool. + /// Is validation environment. + /// The registration info of HostPool. + /// VM template for sessionhosts configuration within hostpool. + /// URL to customer ADFS server for signing WVD SSO certificates. + /// ClientId for the registered Relying Party used to issue WVD SSO certificates. + /// Path to Azure KeyVault storing the secret used for communication to ADFS. + /// The type of single sign on Secret Type. + /// The type of preferred application group type, default to Desktop Application Group. + /// The flag to turn on/off StartVMOnConnect feature. + /// Enabled to allow this resource to be access from the public network. + /// The session host configuration for updating agent, monitoring agent, and stack component. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static HostPoolPatch HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdatePatchProperties agentUpdate) + { + return HostPoolPatch(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, friendlyName: friendlyName, description: description, customRdpProperty: customRdpProperty, maxSessionLimit: maxSessionLimit, personalDesktopAssignmentType: personalDesktopAssignmentType, loadBalancerType: loadBalancerType, ring: ring, isValidationEnvironment: isValidationEnvironment, registrationInfo: registrationInfo, vmTemplate: vmTemplate, ssoAdfsAuthority: ssoAdfsAuthority, ssoClientId: ssoClientId, ssoClientSecretKeyVaultPath: ssoClientSecretKeyVaultPath, ssoSecretType: ssoSecretType, preferredAppGroupType: preferredAppGroupType, startVmOnConnect: startVmOnConnect, publicNetworkAccess: publicNetworkAccess, agentUpdate: agentUpdate, managedPrivateUDP: default, directUDP: default, publicUDP: default, relayUDP: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// ObjectId of SessionHost. (internal use). + /// Last heart beat from SessionHost. + /// Number of sessions on SessionHost. + /// Version of agent on SessionHost. + /// Allow a new session. + /// Virtual Machine Id of SessionHost's underlying virtual machine. + /// Resource Id of SessionHost's underlying virtual machine. + /// User assigned to SessionHost. + /// Friendly name of SessionHost. + /// Status for a SessionHost. + /// The timestamp of the status. + /// The version of the OS on the session host. + /// The version of the side by side stack on the session host. + /// Update state of a SessionHost. + /// The timestamp of the last update. + /// The error message. + /// List of SessionHostHealthCheckReports. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static SessionHostData SessionHostData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string objectId, DateTimeOffset? lastHeartBeatOn, int? sessions, string agentVersion, bool? allowNewSession, string vmId, ResourceIdentifier resourceId, string assignedUser, string friendlyName, SessionHostStatus? status, DateTimeOffset? statusTimestamp, string osVersion, string sxsStackVersion, SessionHostUpdateState? updateState, DateTimeOffset? lastUpdatedOn, string updateErrorMessage, IEnumerable sessionHostHealthCheckResults) + { + return SessionHostData(id: id, name: name, resourceType: resourceType, systemData: systemData, objectId: objectId, lastHeartBeatOn: lastHeartBeatOn, sessions: sessions, agentVersion: agentVersion, allowNewSession: allowNewSession, vmId: vmId, resourceId: resourceId, assignedUser: assignedUser, friendlyName: friendlyName, status: status, statusTimestamp: statusTimestamp, osVersion: osVersion, sxsStackVersion: sxsStackVersion, updateState: updateState, lastUpdatedOn: lastUpdatedOn, updateErrorMessage: updateErrorMessage, lastSessionHostUpdateOn: default, sessionHostConfiguration: default, sessionHostHealthCheckResults: sessionHostHealthCheckResults); + } + + /// Initializes a new instance of . + /// The provisioning state of the App Attach Package. + /// Detailed properties for App Attach Package. + /// List of Hostpool resource Ids. + /// URL path to certificate name located in keyVault. + /// Parameter indicating how the health check should behave if this package fails staging. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AppAttachPackageProperties AppAttachPackageProperties(AppAttachPackageProvisioningState? provisioningState, AppAttachPackageInfoProperties image, IEnumerable hostPoolReferences, Uri keyVaultUri, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure) + { + return AppAttachPackageProperties(provisioningState: provisioningState, image: image, hostPoolReferences: hostPoolReferences, keyVaultUri: keyVaultUri, failHealthCheckOnStagingFailure: failHealthCheckOnStagingFailure, packageOwnerName: default, packageLookbackUri: default, customData: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Detailed properties for App Attach Package. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AppAttachPackagePatch AppAttachPackagePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AppAttachPackagePatchProperties properties) + { + return AppAttachPackagePatch(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: default, properties: properties); + } + /// Initializes a new instance of DesktopVirtualizationPrivateEndpointConnection. /// The id. /// The name. @@ -1049,7 +1463,7 @@ public static DesktopVirtualizationPrivateEndpointConnectionDataData DesktopVirt [EditorBrowsable(EditorBrowsableState.Never)] public static HostPoolData HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IEnumerable applicationGroupReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdateProperties agentUpdate, IEnumerable privateEndpointConnections, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan) { - return HostPoolData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, objectId: objectId, friendlyName: friendlyName, description: description, hostPoolType: hostPoolType, personalDesktopAssignmentType: personalDesktopAssignmentType, customRdpProperty: customRdpProperty, maxSessionLimit: maxSessionLimit, loadBalancerType: loadBalancerType, ring: ring, isValidationEnvironment: isValidationEnvironment, registrationInfo: registrationInfo, vmTemplate: vmTemplate, applicationGroupReferences: applicationGroupReferences, appAttachPackageReferences: default, ssoAdfsAuthority: ssoAdfsAuthority, ssoClientId: ssoClientId, ssoClientSecretKeyVaultPath: ssoClientSecretKeyVaultPath, ssoSecretType: ssoSecretType, preferredAppGroupType: preferredAppGroupType, startVmOnConnect: startVmOnConnect, isCloudPCResource: isCloudPCResource, publicNetworkAccess: publicNetworkAccess, agentUpdate: agentUpdate, privateEndpointConnections: privateEndpointConnections, managedBy: managedBy, kind: kind, etag: etag, identity: identity, sku: sku, plan: plan); + return HostPoolData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, objectId: objectId, friendlyName: friendlyName, description: description, hostPoolType: hostPoolType, personalDesktopAssignmentType: personalDesktopAssignmentType, customRdpProperty: customRdpProperty, maxSessionLimit: maxSessionLimit, loadBalancerType: loadBalancerType, ring: ring, isValidationEnvironment: isValidationEnvironment, registrationInfo: registrationInfo, vmTemplate: vmTemplate, managementType: default, applicationGroupReferences: applicationGroupReferences, appAttachPackageReferences: default, ssoAdfsAuthority: ssoAdfsAuthority, ssoClientId: ssoClientId, ssoClientSecretKeyVaultPath: ssoClientSecretKeyVaultPath, ssoSecretType: ssoSecretType, preferredAppGroupType: preferredAppGroupType, startVmOnConnect: startVmOnConnect, isCloudPCResource: isCloudPCResource, publicNetworkAccess: publicNetworkAccess, agentUpdate: agentUpdate, privateEndpointConnections: privateEndpointConnections, managedPrivateUDP: default, directUDP: default, publicUDP: default, relayUDP: default, managedBy: managedBy, kind: kind, etag: etag, identity: identity, sku: sku, plan: plan); } /// Initializes a new instance of ExpandMsixImage. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs index 641ebfdd02b5..40611ba83dd0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/DesktopVirtualizationExtensions.cs @@ -222,6 +222,63 @@ public static HostPoolResource GetHostPoolResource(this ArmClient client, Resour return GetMockableDesktopVirtualizationArmClient(client).GetHostPoolResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static SessionHostManagementResource GetSessionHostManagementResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDesktopVirtualizationArmClient(client).GetSessionHostManagementResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static SessionHostConfigurationResource GetSessionHostConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDesktopVirtualizationArmClient(client).GetSessionHostConfigurationResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ActiveSessionHostConfigurationResource GetActiveSessionHostConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDesktopVirtualizationArmClient(client).GetActiveSessionHostConfigurationResource(id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -328,7 +385,7 @@ public static VirtualWorkspaceCollection GetVirtualWorkspaces(this ResourceGroup /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -366,7 +423,7 @@ public static async Task> GetVirtualWorkspace /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -421,7 +478,7 @@ public static ScalingPlanCollection GetScalingPlans(this ResourceGroupResource r /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -459,7 +516,7 @@ public static async Task> GetScalingPlanAsync(this /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -514,7 +571,7 @@ public static VirtualApplicationGroupCollection GetVirtualApplicationGroups(this /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -552,7 +609,7 @@ public static async Task> GetVirtualAp /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -607,7 +664,7 @@ public static HostPoolCollection GetHostPools(this ResourceGroupResource resourc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -645,7 +702,7 @@ public static async Task> GetHostPoolAsync(this Resou /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -700,7 +757,7 @@ public static AppAttachPackageCollection GetAppAttachPackages(this ResourceGroup /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -713,7 +770,7 @@ public static AppAttachPackageCollection GetAppAttachPackages(this ResourceGroup /// /// /// The instance the method will execute against. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -738,7 +795,7 @@ public static async Task> GetAppAttachPackage /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -751,7 +808,7 @@ public static async Task> GetAppAttachPackage /// /// /// The instance the method will execute against. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -776,7 +833,7 @@ public static Response GetAppAttachPackage(this Resour /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -812,7 +869,7 @@ public static AsyncPageable GetVirtualWorkspacesAsync( /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -848,7 +905,7 @@ public static Pageable GetVirtualWorkspaces(this Subsc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -887,7 +944,7 @@ public static AsyncPageable GetScalingPlansAsync(this Subsc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -926,7 +983,7 @@ public static Pageable GetScalingPlans(this SubscriptionRes /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -963,7 +1020,7 @@ public static AsyncPageable GetVirtualApplicati /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1000,7 +1057,7 @@ public static Pageable GetVirtualApplicationGro /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1039,7 +1096,7 @@ public static AsyncPageable GetHostPoolsAsync(this Subscriptio /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1078,7 +1135,7 @@ public static Pageable GetHostPools(this SubscriptionResource /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1091,7 +1148,7 @@ public static Pageable GetHostPools(this SubscriptionResource /// /// /// The instance the method will execute against. - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// is null. /// An async collection of that may take multiple service requests to iterate over. @@ -1115,7 +1172,7 @@ public static AsyncPageable GetAppAttachPackagesAsync( /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1128,7 +1185,7 @@ public static AsyncPageable GetAppAttachPackagesAsync( /// /// /// The instance the method will execute against. - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// is null. /// A collection of that may take multiple service requests to iterate over. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationArmClient.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationArmClient.cs index 7efa6c0ac63f..f2cf29481962 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationArmClient.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationArmClient.cs @@ -154,6 +154,42 @@ public virtual HostPoolResource GetHostPoolResource(ResourceIdentifier id) return new HostPoolResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SessionHostManagementResource GetSessionHostManagementResource(ResourceIdentifier id) + { + SessionHostManagementResource.ValidateResourceId(id); + return new SessionHostManagementResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SessionHostConfigurationResource GetSessionHostConfigurationResource(ResourceIdentifier id) + { + SessionHostConfigurationResource.ValidateResourceId(id); + return new SessionHostConfigurationResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ActiveSessionHostConfigurationResource GetActiveSessionHostConfigurationResource(ResourceIdentifier id) + { + ActiveSessionHostConfigurationResource.ValidateResourceId(id); + return new ActiveSessionHostConfigurationResource(Client, id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationResourceGroupResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationResourceGroupResource.cs index 45290221f07e..d455ca53eabb 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationResourceGroupResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual VirtualWorkspaceCollection GetVirtualWorkspaces() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetVirtualWorkspac /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -122,7 +122,7 @@ public virtual ScalingPlanCollection GetScalingPlans() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> GetScalingPlanAsync(str /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -191,7 +191,7 @@ public virtual VirtualApplicationGroupCollection GetVirtualApplicationGroups() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -222,7 +222,7 @@ public virtual async Task> GetVirtualA /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -260,7 +260,7 @@ public virtual HostPoolCollection GetHostPools() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual async Task> GetHostPoolAsync(string ho /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -329,7 +329,7 @@ public virtual AppAttachPackageCollection GetAppAttachPackages() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -337,7 +337,7 @@ public virtual AppAttachPackageCollection GetAppAttachPackages() /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -360,7 +360,7 @@ public virtual async Task> GetAppAttachPackag /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> GetAppAttachPackag /// /// /// - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationSubscriptionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationSubscriptionResource.cs index b29ed49e7ebc..fce7b767a015 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationSubscriptionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Extensions/MockableDesktopVirtualizationSubscriptionResource.cs @@ -68,7 +68,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -98,7 +98,7 @@ public virtual AsyncPageable GetVirtualWorkspacesAsync /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -128,7 +128,7 @@ public virtual Pageable GetVirtualWorkspaces(Cancellat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -161,7 +161,7 @@ public virtual AsyncPageable GetScalingPlansAsync(int? page /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -194,7 +194,7 @@ public virtual Pageable GetScalingPlans(int? pageSize = nul /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual AsyncPageable GetVirtualApplicat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Pageable GetVirtualApplicationGr /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetHostPoolsAsync(int? pageSize = /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetHostPools(int? pageSize = null, boo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -330,7 +330,7 @@ public virtual Pageable GetHostPools(int? pageSize = null, boo /// /// /// - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAppAttachPackagesAsync(string filter = null, CancellationToken cancellationToken = default) @@ -353,7 +353,7 @@ public virtual AsyncPageable GetAppAttachPackagesAsync /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -361,7 +361,7 @@ public virtual AsyncPageable GetAppAttachPackagesAsync /// /// /// - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAppAttachPackages(string filter = null, CancellationToken cancellationToken = default) diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolCollection.cs index 76c4a8cdf508..d7b45082f406 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string hostPoolNa /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string hostPoolName, CancellationT /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = null, /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(int? pageSize = null, bool? isD /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string hostPoolName, Cance /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string hostPoolName, CancellationToken canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.Serialization.cs index 05bc4487299e..5fb208573d39 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.Serialization.cs @@ -57,7 +57,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); } if (Optional.IsDefined(Sku)) { @@ -160,6 +161,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("vmTemplate"u8); writer.WriteStringValue(VmTemplate); } + if (Optional.IsDefined(ManagementType)) + { + writer.WritePropertyName("managementType"u8); + writer.WriteStringValue(ManagementType.Value.ToString()); + } if (options.Format != "W" && Optional.IsCollectionDefined(ApplicationGroupReferences)) { if (ApplicationGroupReferences != null) @@ -266,20 +272,33 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) { - if (PrivateEndpointConnections != null) - { - writer.WritePropertyName("privateEndpointConnections"u8); - writer.WriteStartArray(); - foreach (var item in PrivateEndpointConnections) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - else + writer.WritePropertyName("privateEndpointConnections"u8); + writer.WriteStartArray(); + foreach (var item in PrivateEndpointConnections) { - writer.WriteNull("privateEndpointConnections"); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ManagedPrivateUDP)) + { + writer.WritePropertyName("managedPrivateUDP"u8); + writer.WriteStringValue(ManagedPrivateUDP.Value.ToString()); + } + if (Optional.IsDefined(DirectUDP)) + { + writer.WritePropertyName("directUDP"u8); + writer.WriteStringValue(DirectUDP.Value.ToString()); + } + if (Optional.IsDefined(PublicUDP)) + { + writer.WritePropertyName("publicUDP"u8); + writer.WriteStringValue(PublicUDP.Value.ToString()); + } + if (Optional.IsDefined(RelayUDP)) + { + writer.WritePropertyName("relayUDP"u8); + writer.WriteStringValue(RelayUDP.Value.ToString()); } writer.WriteEndObject(); } @@ -328,6 +347,7 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR bool? validationEnvironment = default; HostPoolRegistrationInfo registrationInfo = default; string vmTemplate = default; + ManagementType? managementType = default; IReadOnlyList applicationGroupReferences = default; IReadOnlyList appAttachPackageReferences = default; string ssoadfsAuthority = default; @@ -340,6 +360,10 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR HostPoolPublicNetworkAccess? publicNetworkAccess = default; SessionHostAgentUpdateProperties agentUpdate = default; IReadOnlyList privateEndpointConnections = default; + ManagedPrivateUDP? managedPrivateUDP = default; + DirectUDP? directUDP = default; + PublicUDP? publicUDP = default; + RelayUDP? relayUDP = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -373,7 +397,8 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } if (property.NameEquals("sku"u8)) @@ -531,6 +556,15 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR vmTemplate = property0.Value.GetString(); continue; } + if (property0.NameEquals("managementType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managementType = new ManagementType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("applicationGroupReferences"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -634,7 +668,6 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR { if (property0.Value.ValueKind == JsonValueKind.Null) { - privateEndpointConnections = null; continue; } List array = new List(); @@ -645,6 +678,42 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR privateEndpointConnections = array; continue; } + if (property0.NameEquals("managedPrivateUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedPrivateUDP = new ManagedPrivateUDP(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("directUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + directUDP = new DirectUDP(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("publicUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicUDP = new PublicUDP(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("relayUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + relayUDP = new RelayUDP(property0.Value.GetString()); + continue; + } } continue; } @@ -673,6 +742,7 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR validationEnvironment, registrationInfo, vmTemplate, + managementType, applicationGroupReferences ?? new ChangeTrackingList(), appAttachPackageReferences ?? new ChangeTrackingList(), ssoadfsAuthority, @@ -685,6 +755,10 @@ internal static HostPoolData DeserializeHostPoolData(JsonElement element, ModelR publicNetworkAccess, agentUpdate, privateEndpointConnections ?? new ChangeTrackingList(), + managedPrivateUDP, + directUDP, + publicUDP, + relayUDP, managedBy, kind, etag, @@ -1122,6 +1196,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagementType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" managementType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ManagementType)) + { + builder.Append(" managementType: "); + builder.AppendLine($"'{ManagementType.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ApplicationGroupReferences), out propertyOverride); if (hasPropertyOverride) { @@ -1375,6 +1464,66 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagedPrivateUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" managedPrivateUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ManagedPrivateUDP)) + { + builder.Append(" managedPrivateUDP: "); + builder.AppendLine($"'{ManagedPrivateUDP.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DirectUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" directUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DirectUDP)) + { + builder.Append(" directUDP: "); + builder.AppendLine($"'{DirectUDP.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublicUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publicUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublicUDP)) + { + builder.Append(" publicUDP: "); + builder.AppendLine($"'{PublicUDP.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RelayUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" relayUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RelayUDP)) + { + builder.Append(" relayUDP: "); + builder.AppendLine($"'{RelayUDP.Value.ToString()}'"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs index 5a870d8b5a30..691f11754a80 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolData.cs @@ -83,8 +83,9 @@ public HostPoolData(AzureLocation location, HostPoolType hostPoolType, HostPoolL /// The type of the load balancer. /// The ring number of HostPool. /// Is validation environment. - /// The registration info of HostPool. + /// The registration info of HostPool. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. /// VM template for sessionhosts configuration within hostpool. + /// The type of management for this hostpool, Automated or Standard. The default value is Automated. /// List of applicationGroup links. /// List of App Attach Package links. /// URL to customer ADFS server for signing WVD SSO certificates. @@ -97,14 +98,18 @@ public HostPoolData(AzureLocation location, HostPoolType hostPoolType, HostPoolL /// Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only be accessed via private endpoints. /// The session host configuration for updating agent, monitoring agent, and stack component. /// List of private endpoint connection associated with the specified resource. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// Keeps track of any properties unknown to the library. - internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, IReadOnlyList applicationGroupReferences, IReadOnlyList appAttachPackageReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdateProperties agentUpdate, IReadOnlyList privateEndpointConnections, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string friendlyName, string description, HostPoolType hostPoolType, PersonalDesktopAssignmentType? personalDesktopAssignmentType, string customRdpProperty, int? maxSessionLimit, HostPoolLoadBalancerType loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfo registrationInfo, string vmTemplate, ManagementType? managementType, IReadOnlyList applicationGroupReferences, IReadOnlyList appAttachPackageReferences, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType preferredAppGroupType, bool? startVmOnConnect, bool? isCloudPCResource, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdateProperties agentUpdate, IReadOnlyList privateEndpointConnections, ManagedPrivateUDP? managedPrivateUDP, DirectUDP? directUDP, PublicUDP? publicUDP, RelayUDP? relayUDP, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ObjectId = objectId; FriendlyName = friendlyName; @@ -118,6 +123,7 @@ internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceT IsValidationEnvironment = isValidationEnvironment; RegistrationInfo = registrationInfo; VmTemplate = vmTemplate; + ManagementType = managementType; ApplicationGroupReferences = applicationGroupReferences; AppAttachPackageReferences = appAttachPackageReferences; SsoAdfsAuthority = ssoAdfsAuthority; @@ -130,6 +136,10 @@ internal HostPoolData(ResourceIdentifier id, string name, ResourceType resourceT PublicNetworkAccess = publicNetworkAccess; AgentUpdate = agentUpdate; PrivateEndpointConnections = privateEndpointConnections; + ManagedPrivateUDP = managedPrivateUDP; + DirectUDP = directUDP; + PublicUDP = publicUDP; + RelayUDP = relayUDP; ManagedBy = managedBy; Kind = kind; ETag = etag; @@ -174,12 +184,15 @@ internal HostPoolData() /// Is validation environment. [WirePath("properties.validationEnvironment")] public bool? IsValidationEnvironment { get; set; } - /// The registration info of HostPool. + /// The registration info of HostPool. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. [WirePath("properties.registrationInfo")] public HostPoolRegistrationInfo RegistrationInfo { get; set; } /// VM template for sessionhosts configuration within hostpool. [WirePath("properties.vmTemplate")] public string VmTemplate { get; set; } + /// The type of management for this hostpool, Automated or Standard. The default value is Automated. + [WirePath("properties.managementType")] + public ManagementType? ManagementType { get; set; } /// List of applicationGroup links. [WirePath("properties.applicationGroupReferences")] public IReadOnlyList ApplicationGroupReferences { get; } @@ -216,6 +229,18 @@ internal HostPoolData() /// List of private endpoint connection associated with the specified resource. [WirePath("properties.privateEndpointConnections")] public IReadOnlyList PrivateEndpointConnections { get; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.managedPrivateUDP")] + public ManagedPrivateUDP? ManagedPrivateUDP { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.directUDP")] + public DirectUDP? DirectUDP { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.publicUDP")] + public PublicUDP? PublicUDP { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.relayUDP")] + public RelayUDP? RelayUDP { get; set; } /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. [WirePath("managedBy")] public ResourceIdentifier ManagedBy { get; set; } @@ -225,13 +250,13 @@ internal HostPoolData() /// The etag field is *not* required. If it is provided in the response body, it must 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. [WirePath("etag")] public ETag? ETag { get; } - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// The resource model definition representing SKU. [WirePath("sku")] public DesktopVirtualizationSku Sku { get; set; } - /// Gets or sets the plan. + /// Plan for the resource. [WirePath("plan")] public ArmPlan Plan { get; set; } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs index 33ffc142b577..5839d4e66901 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string pr /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(int? p /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs index 306816ca5eaf..ee7801abbfb9 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolPrivateEndpointConnectionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs index 97f440be1dc0..2e2c48c88eea 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/HostPoolResource.cs @@ -133,7 +133,7 @@ public virtual HostPoolPrivateEndpointConnectionCollection GetHostPoolPrivateEnd /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -164,7 +164,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,6 +182,27 @@ public virtual Response GetHostPoolPr return GetHostPoolPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } + /// Gets an object representing a SessionHostManagementResource along with the instance operations that can be performed on it in the HostPool. + /// Returns a object. + public virtual SessionHostManagementResource GetSessionHostManagement() + { + return new SessionHostManagementResource(Client, Id.AppendChildResource("sessionHostManagements", "default")); + } + + /// Gets an object representing a SessionHostConfigurationResource along with the instance operations that can be performed on it in the HostPool. + /// Returns a object. + public virtual SessionHostConfigurationResource GetSessionHostConfiguration() + { + return new SessionHostConfigurationResource(Client, Id.AppendChildResource("sessionHostConfigurations", "default")); + } + + /// Gets an object representing a ActiveSessionHostConfigurationResource along with the instance operations that can be performed on it in the HostPool. + /// Returns a object. + public virtual ActiveSessionHostConfigurationResource GetActiveSessionHostConfiguration() + { + return new ActiveSessionHostConfigurationResource(Client, Id.AppendChildResource("activeSessionHostConfigurations", "default")); + } + /// Gets a collection of SessionHostResources in the HostPool. /// An object representing collection of SessionHostResources and their operations over a SessionHostResource. public virtual SessionHostCollection GetSessionHosts() @@ -202,7 +223,7 @@ public virtual SessionHostCollection GetSessionHosts() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -233,7 +254,7 @@ public virtual async Task> GetSessionHostAsync(str /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -271,7 +292,7 @@ public virtual MsixPackageCollection GetMsixPackages() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -302,7 +323,7 @@ public virtual async Task> GetMsixPackageAsync(str /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -333,7 +354,7 @@ public virtual Response GetMsixPackage(string msixPackageFu /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -373,7 +394,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -413,7 +434,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -458,7 +479,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -503,7 +524,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? force = null, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -545,7 +566,7 @@ public virtual async Task> UpdateAsync(HostPoolPatch /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -587,7 +608,7 @@ public virtual Response Update(HostPoolPatch patch, Cancellati /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -616,7 +637,7 @@ public virtual AsyncPageable GetPr /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -645,7 +666,7 @@ public virtual Pageable GetPrivate /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -678,7 +699,7 @@ public virtual AsyncPageable GetScalingPlansAsync(int? page /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -711,7 +732,7 @@ public virtual Pageable GetScalingPlans(int? pageSize = nul /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -749,7 +770,7 @@ public virtual async Task> RetrieveRegistrati /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -774,6 +795,64 @@ public virtual Response RetrieveRegistrationToken(Canc } } + /// + /// Operation to list the RegistrationTokens associated with the HostPool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens + /// + /// + /// Operation Id + /// HostPools_ListRegistrationTokens + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetRegistrationTokensAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _hostPoolRestClient.CreateListRegistrationTokensRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => RegistrationTokenMinimal.DeserializeRegistrationTokenMinimal(e), _hostPoolClientDiagnostics, Pipeline, "HostPoolResource.GetRegistrationTokens", "value", null, cancellationToken); + } + + /// + /// Operation to list the RegistrationTokens associated with the HostPool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/listRegistrationTokens + /// + /// + /// Operation Id + /// HostPools_ListRegistrationTokens + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetRegistrationTokens(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _hostPoolRestClient.CreateListRegistrationTokensRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => RegistrationTokenMinimal.DeserializeRegistrationTokenMinimal(e), _hostPoolClientDiagnostics, Pipeline, "HostPoolResource.GetRegistrationTokens", "value", null, cancellationToken); + } + /// /// List userSessions. /// @@ -787,7 +866,7 @@ public virtual Response RetrieveRegistrationToken(Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -821,7 +900,7 @@ public virtual AsyncPageable GetUserSessionsAsync(string fi /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -855,7 +934,7 @@ public virtual Pageable GetUserSessions(string filter = nul /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -885,7 +964,7 @@ public virtual AsyncPageable ImportAppAttachPackageInf /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -915,7 +994,7 @@ public virtual Pageable ImportAppAttachPackageInfos(Im /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -945,7 +1024,7 @@ public virtual AsyncPageable ExpandMsixImagesAsync(MsixImageUri /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -975,7 +1054,7 @@ public virtual Pageable ExpandMsixImages(MsixImageUri msixImage /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1037,7 +1116,7 @@ public virtual async Task> AddTagAsync(string key, st /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1099,7 +1178,7 @@ public virtual Response AddTag(string key, string value, Cance /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1156,7 +1235,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1213,7 +1292,7 @@ public virtual Response SetTags(IDictionary ta /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -1273,7 +1352,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/LongRunningOperation/SessionHostConfigurationOperationSource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/LongRunningOperation/SessionHostConfigurationOperationSource.cs new file mode 100644 index 000000000000..31218d597d27 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/LongRunningOperation/SessionHostConfigurationOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal class SessionHostConfigurationOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SessionHostConfigurationOperationSource(ArmClient client) + { + _client = client; + } + + SessionHostConfigurationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = SessionHostConfigurationData.DeserializeSessionHostConfigurationData(document.RootElement); + return new SessionHostConfigurationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = SessionHostConfigurationData.DeserializeSessionHostConfigurationData(document.RootElement); + return new SessionHostConfigurationResource(_client, data); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..e559a89b1268 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class ActiveDirectoryInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveDirectoryInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DomainCredentials)) + { + writer.WritePropertyName("domainCredentials"u8); + writer.WriteObjectValue(DomainCredentials, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActiveDirectoryInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveDirectoryInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActiveDirectoryInfoPatchProperties(document.RootElement, options); + } + + internal static ActiveDirectoryInfoPatchProperties DeserializeActiveDirectoryInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyVaultCredentialsPatchProperties domainCredentials = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("domainCredentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainCredentials = KeyVaultCredentialsPatchProperties.DeserializeKeyVaultCredentialsPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActiveDirectoryInfoPatchProperties(domainCredentials, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ActiveDirectoryInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + ActiveDirectoryInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActiveDirectoryInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActiveDirectoryInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoPatchProperties.cs new file mode 100644 index 000000000000..619f0aabc0ca --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoPatchProperties.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Active directory info. Only one should be populated based on the join type. + internal partial class ActiveDirectoryInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ActiveDirectoryInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// Credentials needed to create the virtual machine. + /// Keeps track of any properties unknown to the library. + internal ActiveDirectoryInfoPatchProperties(KeyVaultCredentialsPatchProperties domainCredentials, IDictionary serializedAdditionalRawData) + { + DomainCredentials = domainCredentials; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Credentials needed to create the virtual machine. + [WirePath("domainCredentials")] + public KeyVaultCredentialsPatchProperties DomainCredentials { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoProperties.Serialization.cs new file mode 100644 index 000000000000..bb08f52c0cb1 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoProperties.Serialization.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class ActiveDirectoryInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveDirectoryInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("domainCredentials"u8); + writer.WriteObjectValue(DomainCredentials, options); + writer.WritePropertyName("ouPath"u8); + writer.WriteStringValue(OuPath); + if (Optional.IsDefined(DomainName)) + { + writer.WritePropertyName("domainName"u8); + writer.WriteStringValue(DomainName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActiveDirectoryInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveDirectoryInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActiveDirectoryInfoProperties(document.RootElement, options); + } + + internal static ActiveDirectoryInfoProperties DeserializeActiveDirectoryInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + KeyVaultCredentialsProperties domainCredentials = default; + string ouPath = default; + string domainName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("domainCredentials"u8)) + { + domainCredentials = KeyVaultCredentialsProperties.DeserializeKeyVaultCredentialsProperties(property.Value, options); + continue; + } + if (property.NameEquals("ouPath"u8)) + { + ouPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("domainName"u8)) + { + domainName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActiveDirectoryInfoProperties(domainCredentials, ouPath, domainName, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DomainCredentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" domainCredentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DomainCredentials)) + { + builder.Append(" domainCredentials: "); + BicepSerializationHelpers.AppendChildObject(builder, DomainCredentials, options, 2, false, " domainCredentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OuPath), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ouPath: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OuPath)) + { + builder.Append(" ouPath: "); + if (OuPath.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OuPath}'''"); + } + else + { + builder.AppendLine($"'{OuPath}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DomainName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" domainName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DomainName)) + { + builder.Append(" domainName: "); + if (DomainName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DomainName}'''"); + } + else + { + builder.AppendLine($"'{DomainName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ActiveDirectoryInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + ActiveDirectoryInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActiveDirectoryInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActiveDirectoryInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoProperties.cs new file mode 100644 index 000000000000..baf61fefeccc --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveDirectoryInfoProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Active directory info. Only one should be populated based on the join type. + public partial class ActiveDirectoryInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Credentials needed to create the virtual machine. + /// The organizational unit(OU) path. + /// or is null. + public ActiveDirectoryInfoProperties(KeyVaultCredentialsProperties domainCredentials, string ouPath) + { + Argument.AssertNotNull(domainCredentials, nameof(domainCredentials)); + Argument.AssertNotNull(ouPath, nameof(ouPath)); + + DomainCredentials = domainCredentials; + OuPath = ouPath; + } + + /// Initializes a new instance of . + /// Credentials needed to create the virtual machine. + /// The organizational unit(OU) path. + /// The domain a virtual machine connected to a hostpool will join. + /// Keeps track of any properties unknown to the library. + internal ActiveDirectoryInfoProperties(KeyVaultCredentialsProperties domainCredentials, string ouPath, string domainName, IDictionary serializedAdditionalRawData) + { + DomainCredentials = domainCredentials; + OuPath = ouPath; + DomainName = domainName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ActiveDirectoryInfoProperties() + { + } + + /// Credentials needed to create the virtual machine. + [WirePath("domainCredentials")] + public KeyVaultCredentialsProperties DomainCredentials { get; set; } + /// The organizational unit(OU) path. + [WirePath("ouPath")] + public string OuPath { get; set; } + /// The domain a virtual machine connected to a hostpool will join. + [WirePath("domainName")] + public string DomainName { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveSessionHostConfigurationList.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveSessionHostConfigurationList.Serialization.cs new file mode 100644 index 000000000000..41828989917a --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveSessionHostConfigurationList.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class ActiveSessionHostConfigurationList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ActiveSessionHostConfigurationList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeActiveSessionHostConfigurationList(document.RootElement, options); + } + + internal static ActiveSessionHostConfigurationList DeserializeActiveSessionHostConfigurationList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ActiveSessionHostConfigurationData.DeserializeActiveSessionHostConfigurationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ActiveSessionHostConfigurationList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationList)} does not support writing '{options.Format}' format."); + } + } + + ActiveSessionHostConfigurationList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeActiveSessionHostConfigurationList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ActiveSessionHostConfigurationList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveSessionHostConfigurationList.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveSessionHostConfigurationList.cs new file mode 100644 index 000000000000..64f67c5b5257 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ActiveSessionHostConfigurationList.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// List of ActiveSessionHostConfiguration definitions. + internal partial class ActiveSessionHostConfigurationList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ActiveSessionHostConfigurationList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of ActiveSessionHostConfiguration definitions. + /// Link to the next page of results. + /// Keeps track of any properties unknown to the library. + internal ActiveSessionHostConfigurationList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of ActiveSessionHostConfiguration definitions. + public IReadOnlyList Value { get; } + /// Link to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageInfoProperties.cs index 150139b210a3..75f9f111631b 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageInfoProperties.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageInfoProperties.cs @@ -54,17 +54,17 @@ public AppAttachPackageInfoProperties() /// Initializes a new instance of . /// Alias of App Attach Package. Assigned at import time. - /// VHD/CIM image path on Network Share. + /// VHD/CIM/APP-V image path on Network Share. /// Package Name from appxmanifest.xml. - /// Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. - /// Package Full Name from appxmanifest.xml. + /// Identifier not including the package version, for Msix packages it is the family name from the appxmanifest.xml. + /// Identifier including the package version, for Msix packages it is the full name from the appxmanifest.xml. /// User friendly Name to be displayed in the portal. /// Relative Path to the package inside the image. /// Specifies how to register Package in feed. /// Make this version of the package the active one across the hostpool. /// List of package dependencies. - /// Package version found in the appxmanifest.xml. - /// Date Package was last updated, found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. + /// Date the package source was last updated, for Msix packages this is found in the appxmanifest.xml. /// List of package applications. /// Certificate name found in the appxmanifest.xml. /// Date certificate expires, found in the appxmanifest.xml. @@ -94,16 +94,16 @@ internal AppAttachPackageInfoProperties(string packageAlias, string imagePath, s /// Alias of App Attach Package. Assigned at import time. [WirePath("packageAlias")] public string PackageAlias { get; set; } - /// VHD/CIM image path on Network Share. + /// VHD/CIM/APP-V image path on Network Share. [WirePath("imagePath")] public string ImagePath { get; set; } /// Package Name from appxmanifest.xml. [WirePath("packageName")] public string PackageName { get; set; } - /// Package Family Name from appxmanifest.xml. Contains Package Name and Publisher name. + /// Identifier not including the package version, for Msix packages it is the family name from the appxmanifest.xml. [WirePath("packageFamilyName")] public string PackageFamilyName { get; set; } - /// Package Full Name from appxmanifest.xml. + /// Identifier including the package version, for Msix packages it is the full name from the appxmanifest.xml. [WirePath("packageFullName")] public string PackageFullName { get; set; } /// User friendly Name to be displayed in the portal. @@ -121,10 +121,10 @@ internal AppAttachPackageInfoProperties(string packageAlias, string imagePath, s /// List of package dependencies. [WirePath("packageDependencies")] public IList PackageDependencies { get; set; } - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. [WirePath("version")] public string Version { get; set; } - /// Date Package was last updated, found in the appxmanifest.xml. + /// Date the package source was last updated, for Msix packages this is found in the appxmanifest.xml. [WirePath("lastUpdated")] public DateTimeOffset? LastUpdatedOn { get; set; } /// List of package applications. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.Serialization.cs index 0e03ba8f35e8..bce6dd1c65a3 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -37,6 +38,17 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -64,6 +76,7 @@ internal static AppAttachPackagePatch DeserializeAppAttachPackagePatch(JsonEleme { return null; } + IDictionary tags = default; AppAttachPackagePatchProperties properties = default; ResourceIdentifier id = default; string name = default; @@ -73,6 +86,20 @@ internal static AppAttachPackagePatch DeserializeAppAttachPackagePatch(JsonEleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -117,6 +144,7 @@ internal static AppAttachPackagePatch DeserializeAppAttachPackagePatch(JsonEleme name, type, systemData, + tags ?? new ChangeTrackingDictionary(), properties, serializedAdditionalRawData); } @@ -155,6 +183,43 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.cs index 7db935c8b41a..8a687095d165 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatch.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.DesktopVirtualization.Models { - /// Schema for updatable App Attach Package properties. + /// Schema for patchable App Attach Package properties. public partial class AppAttachPackagePatch : ResourceData { /// @@ -50,6 +50,7 @@ public partial class AppAttachPackagePatch : ResourceData /// Initializes a new instance of . public AppAttachPackagePatch() { + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -57,14 +58,19 @@ public AppAttachPackagePatch() /// The name. /// The resourceType. /// The systemData. + /// tags to be updated. /// Detailed properties for App Attach Package. /// Keeps track of any properties unknown to the library. - internal AppAttachPackagePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AppAttachPackagePatchProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal AppAttachPackagePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AppAttachPackagePatchProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { + Tags = tags; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// tags to be updated. + [WirePath("tags")] + public IDictionary Tags { get; } /// Detailed properties for App Attach Package. [WirePath("properties")] public AppAttachPackagePatchProperties Properties { get; set; } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.Serialization.cs index 4db441d135e5..cbb9eba2c386 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.Serialization.cs @@ -66,6 +66,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("failHealthCheckOnStagingFailure"u8); writer.WriteStringValue(FailHealthCheckOnStagingFailure.Value.ToString()); } + if (Optional.IsDefined(PackageLookbackUri)) + { + writer.WritePropertyName("packageLookbackUrl"u8); + writer.WriteStringValue(PackageLookbackUri.AbsoluteUri); + } + if (Optional.IsDefined(CustomData)) + { + writer.WritePropertyName("customData"u8); + writer.WriteStringValue(CustomData); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -107,6 +117,8 @@ internal static AppAttachPackagePatchProperties DeserializeAppAttachPackagePatch IList hostPoolReferences = default; Uri keyVaultURL = default; FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure = default; + Uri packageLookbackUrl = default; + string customData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -159,13 +171,34 @@ internal static AppAttachPackagePatchProperties DeserializeAppAttachPackagePatch failHealthCheckOnStagingFailure = new FailHealthCheckOnStagingFailure(property.Value.GetString()); continue; } + if (property.NameEquals("packageLookbackUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + packageLookbackUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("customData"u8)) + { + customData = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new AppAttachPackagePatchProperties(image, hostPoolReferences ?? new ChangeTrackingList(), keyVaultURL, failHealthCheckOnStagingFailure, serializedAdditionalRawData); + return new AppAttachPackagePatchProperties( + image, + hostPoolReferences ?? new ChangeTrackingList(), + keyVaultURL, + failHealthCheckOnStagingFailure, + packageLookbackUrl, + customData, + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -252,6 +285,44 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PackageLookbackUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" packageLookbackUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PackageLookbackUri)) + { + builder.Append(" packageLookbackUrl: "); + builder.AppendLine($"'{PackageLookbackUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CustomData)) + { + builder.Append(" customData: "); + if (CustomData.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CustomData}'''"); + } + else + { + builder.AppendLine($"'{CustomData}'"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.cs index 9cab5040c943..0d16d0957677 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackagePatchProperties.cs @@ -55,15 +55,19 @@ public AppAttachPackagePatchProperties() /// Initializes a new instance of . /// Detailed properties for App Attach Package. /// List of Hostpool resource Ids. - /// URL path to certificate name located in keyVault. + /// URL of keyvault location to store certificate. /// Parameter indicating how the health check should behave if this package fails staging. + /// Lookback url to third party control plane, should be null for first party packages. + /// Field that can be populated with custom data and filtered on in list GET calls. /// Keeps track of any properties unknown to the library. - internal AppAttachPackagePatchProperties(AppAttachPackageInfoProperties image, IList hostPoolReferences, Uri keyVaultUri, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure, IDictionary serializedAdditionalRawData) + internal AppAttachPackagePatchProperties(AppAttachPackageInfoProperties image, IList hostPoolReferences, Uri keyVaultUri, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure, Uri packageLookbackUri, string customData, IDictionary serializedAdditionalRawData) { Image = image; HostPoolReferences = hostPoolReferences; KeyVaultUri = keyVaultUri; FailHealthCheckOnStagingFailure = failHealthCheckOnStagingFailure; + PackageLookbackUri = packageLookbackUri; + CustomData = customData; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -73,11 +77,17 @@ internal AppAttachPackagePatchProperties(AppAttachPackageInfoProperties image, I /// List of Hostpool resource Ids. [WirePath("hostPoolReferences")] public IList HostPoolReferences { get; } - /// URL path to certificate name located in keyVault. + /// URL of keyvault location to store certificate. [WirePath("keyVaultURL")] public Uri KeyVaultUri { get; set; } /// Parameter indicating how the health check should behave if this package fails staging. [WirePath("failHealthCheckOnStagingFailure")] public FailHealthCheckOnStagingFailure? FailHealthCheckOnStagingFailure { get; set; } + /// Lookback url to third party control plane, should be null for first party packages. + [WirePath("packageLookbackUrl")] + public Uri PackageLookbackUri { get; set; } + /// Field that can be populated with custom data and filtered on in list GET calls. + [WirePath("customData")] + public string CustomData { get; set; } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.Serialization.cs index ea453d33c498..d88484baedb0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.Serialization.cs @@ -66,6 +66,28 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("failHealthCheckOnStagingFailure"u8); writer.WriteStringValue(FailHealthCheckOnStagingFailure.Value.ToString()); } + if (Optional.IsDefined(PackageOwnerName)) + { + writer.WritePropertyName("packageOwnerName"u8); + writer.WriteStringValue(PackageOwnerName); + } + if (Optional.IsDefined(PackageLookbackUri)) + { + if (PackageLookbackUri != null) + { + writer.WritePropertyName("packageLookbackUrl"u8); + writer.WriteStringValue(PackageLookbackUri.AbsoluteUri); + } + else + { + writer.WriteNull("packageLookbackUrl"); + } + } + if (Optional.IsDefined(CustomData)) + { + writer.WritePropertyName("customData"u8); + writer.WriteStringValue(CustomData); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -108,6 +130,9 @@ internal static AppAttachPackageProperties DeserializeAppAttachPackageProperties IList hostPoolReferences = default; Uri keyVaultURL = default; FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure = default; + string packageOwnerName = default; + Uri packageLookbackUrl = default; + string customData = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -162,6 +187,26 @@ internal static AppAttachPackageProperties DeserializeAppAttachPackageProperties failHealthCheckOnStagingFailure = new FailHealthCheckOnStagingFailure(property.Value.GetString()); continue; } + if (property.NameEquals("packageOwnerName"u8)) + { + packageOwnerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("packageLookbackUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + packageLookbackUrl = null; + continue; + } + packageLookbackUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("customData"u8)) + { + customData = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -174,6 +219,9 @@ internal static AppAttachPackageProperties DeserializeAppAttachPackageProperties hostPoolReferences ?? new ChangeTrackingList(), keyVaultURL, failHealthCheckOnStagingFailure, + packageOwnerName, + packageLookbackUrl, + customData, serializedAdditionalRawData); } @@ -284,6 +332,67 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PackageOwnerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" packageOwnerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PackageOwnerName)) + { + builder.Append(" packageOwnerName: "); + if (PackageOwnerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PackageOwnerName}'''"); + } + else + { + builder.AppendLine($"'{PackageOwnerName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PackageLookbackUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" packageLookbackUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PackageLookbackUri)) + { + builder.Append(" packageLookbackUrl: "); + builder.AppendLine($"'{PackageLookbackUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CustomData)) + { + builder.Append(" customData: "); + if (CustomData.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CustomData}'''"); + } + else + { + builder.AppendLine($"'{CustomData}'"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.cs index 5ed2b98f68d7..68011a27f3ec 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AppAttachPackageProperties.cs @@ -55,16 +55,22 @@ public AppAttachPackageProperties() /// The provisioning state of the App Attach Package. /// Detailed properties for App Attach Package. /// List of Hostpool resource Ids. - /// URL path to certificate name located in keyVault. + /// URL of keyvault location to store certificate. /// Parameter indicating how the health check should behave if this package fails staging. + /// Specific name of package owner, is "AppAttach" for native app attach packages. + /// Lookback url to third party control plane, is null for native app attach packages. + /// Field that can be populated with custom data and filtered on in list GET calls. /// Keeps track of any properties unknown to the library. - internal AppAttachPackageProperties(AppAttachPackageProvisioningState? provisioningState, AppAttachPackageInfoProperties image, IList hostPoolReferences, Uri keyVaultUri, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure, IDictionary serializedAdditionalRawData) + internal AppAttachPackageProperties(AppAttachPackageProvisioningState? provisioningState, AppAttachPackageInfoProperties image, IList hostPoolReferences, Uri keyVaultUri, FailHealthCheckOnStagingFailure? failHealthCheckOnStagingFailure, string packageOwnerName, Uri packageLookbackUri, string customData, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; Image = image; HostPoolReferences = hostPoolReferences; KeyVaultUri = keyVaultUri; FailHealthCheckOnStagingFailure = failHealthCheckOnStagingFailure; + PackageOwnerName = packageOwnerName; + PackageLookbackUri = packageLookbackUri; + CustomData = customData; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -77,11 +83,20 @@ internal AppAttachPackageProperties(AppAttachPackageProvisioningState? provision /// List of Hostpool resource Ids. [WirePath("hostPoolReferences")] public IList HostPoolReferences { get; } - /// URL path to certificate name located in keyVault. + /// URL of keyvault location to store certificate. [WirePath("keyVaultURL")] public Uri KeyVaultUri { get; set; } /// Parameter indicating how the health check should behave if this package fails staging. [WirePath("failHealthCheckOnStagingFailure")] public FailHealthCheckOnStagingFailure? FailHealthCheckOnStagingFailure { get; set; } + /// Specific name of package owner, is "AppAttach" for native app attach packages. + [WirePath("packageOwnerName")] + public string PackageOwnerName { get; set; } + /// Lookback url to third party control plane, is null for native app attach packages. + [WirePath("packageLookbackUrl")] + public Uri PackageLookbackUri { get; set; } + /// Field that can be populated with custom data and filtered on in list GET calls. + [WirePath("customData")] + public string CustomData { get; set; } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AzureActiveDirectoryInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AzureActiveDirectoryInfoProperties.Serialization.cs new file mode 100644 index 000000000000..58959ee32411 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AzureActiveDirectoryInfoProperties.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class AzureActiveDirectoryInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureActiveDirectoryInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("mdmProviderGuid"u8); + writer.WriteStringValue(MdmProviderGuid); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzureActiveDirectoryInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureActiveDirectoryInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureActiveDirectoryInfoProperties(document.RootElement, options); + } + + internal static AzureActiveDirectoryInfoProperties DeserializeAzureActiveDirectoryInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string mdmProviderGuid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mdmProviderGuid"u8)) + { + mdmProviderGuid = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureActiveDirectoryInfoProperties(mdmProviderGuid, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MdmProviderGuid), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" mdmProviderGuid: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MdmProviderGuid)) + { + builder.Append(" mdmProviderGuid: "); + if (MdmProviderGuid.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MdmProviderGuid}'''"); + } + else + { + builder.AppendLine($"'{MdmProviderGuid}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(AzureActiveDirectoryInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + AzureActiveDirectoryInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureActiveDirectoryInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureActiveDirectoryInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AzureActiveDirectoryInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AzureActiveDirectoryInfoProperties.cs new file mode 100644 index 000000000000..53c6097fe555 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/AzureActiveDirectoryInfoProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Azure Active directory info. Only one should be populated based on the join type. + internal partial class AzureActiveDirectoryInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Mobile Device Management(MDM) guid. + /// is null. + public AzureActiveDirectoryInfoProperties(string mdmProviderGuid) + { + Argument.AssertNotNull(mdmProviderGuid, nameof(mdmProviderGuid)); + + MdmProviderGuid = mdmProviderGuid; + } + + /// Initializes a new instance of . + /// The Mobile Device Management(MDM) guid. + /// Keeps track of any properties unknown to the library. + internal AzureActiveDirectoryInfoProperties(string mdmProviderGuid, IDictionary serializedAdditionalRawData) + { + MdmProviderGuid = mdmProviderGuid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzureActiveDirectoryInfoProperties() + { + } + + /// The Mobile Device Management(MDM) guid. + [WirePath("mdmProviderGuid")] + public string MdmProviderGuid { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..6161e1fb384a --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoPatchProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class BootDiagnosticsInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BootDiagnosticsInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(StorageUri)) + { + writer.WritePropertyName("storageUri"u8); + writer.WriteStringValue(StorageUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BootDiagnosticsInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BootDiagnosticsInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBootDiagnosticsInfoPatchProperties(document.RootElement, options); + } + + internal static BootDiagnosticsInfoPatchProperties DeserializeBootDiagnosticsInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + Uri storageUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("storageUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BootDiagnosticsInfoPatchProperties(enabled, storageUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BootDiagnosticsInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + BootDiagnosticsInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBootDiagnosticsInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BootDiagnosticsInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoPatchProperties.cs new file mode 100644 index 000000000000..bfe54f4305d7 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoPatchProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + public partial class BootDiagnosticsInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BootDiagnosticsInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// Whether boot diagnostics should be enabled on the Virtual Machine. + /// Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + /// Keeps track of any properties unknown to the library. + internal BootDiagnosticsInfoPatchProperties(bool? enabled, Uri storageUri, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + StorageUri = storageUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether boot diagnostics should be enabled on the Virtual Machine. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + [WirePath("storageUri")] + public Uri StorageUri { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoProperties.Serialization.cs new file mode 100644 index 000000000000..d08c51879c90 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoProperties.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class BootDiagnosticsInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BootDiagnosticsInfoProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(StorageUri)) + { + if (StorageUri != null) + { + writer.WritePropertyName("storageUri"u8); + writer.WriteStringValue(StorageUri.AbsoluteUri); + } + else + { + writer.WriteNull("storageUri"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + BootDiagnosticsInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BootDiagnosticsInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBootDiagnosticsInfoProperties(document.RootElement, options); + } + + internal static BootDiagnosticsInfoProperties DeserializeBootDiagnosticsInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + Uri storageUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("storageUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + storageUri = null; + continue; + } + storageUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BootDiagnosticsInfoProperties(enabled, storageUri, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Enabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Enabled)) + { + builder.Append(" enabled: "); + var boolValue = Enabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StorageUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StorageUri)) + { + builder.Append(" storageUri: "); + builder.AppendLine($"'{StorageUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(BootDiagnosticsInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + BootDiagnosticsInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBootDiagnosticsInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BootDiagnosticsInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoProperties.cs new file mode 100644 index 000000000000..52c5e66bdf7b --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/BootDiagnosticsInfoProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> You can easily view the output of your console log. <br><br> Azure also enables you to see a screenshot of the VM from the hypervisor. + public partial class BootDiagnosticsInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BootDiagnosticsInfoProperties() + { + } + + /// Initializes a new instance of . + /// Whether boot diagnostics should be enabled on the Virtual Machine. + /// Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + /// Keeps track of any properties unknown to the library. + internal BootDiagnosticsInfoProperties(bool? enabled, Uri storageUri, IDictionary serializedAdditionalRawData) + { + Enabled = enabled; + StorageUri = storageUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether boot diagnostics should be enabled on the Virtual Machine. + [WirePath("enabled")] + public bool? Enabled { get; set; } + /// Uri of the storage account to use for placing the console output and screenshot. <br><br>If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + [WirePath("storageUri")] + public Uri StorageUri { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..8334b5a70ab9 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class CustomInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomInfoPatchProperties(document.RootElement, options); + } + + internal static CustomInfoPatchProperties DeserializeCustomInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomInfoPatchProperties(resourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + CustomInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoPatchProperties.cs new file mode 100644 index 000000000000..dc841215a87f --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoPatchProperties.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Custom image information. + internal partial class CustomInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CustomInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// The resource id of the custom image. + /// Keeps track of any properties unknown to the library. + internal CustomInfoPatchProperties(ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource id of the custom image. + [WirePath("resourceId")] + public ResourceIdentifier ResourceId { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoProperties.Serialization.cs new file mode 100644 index 000000000000..b90178e5b160 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoProperties.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class CustomInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomInfoProperties(document.RootElement, options); + } + + internal static CustomInfoProperties DeserializeCustomInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomInfoProperties(resourceId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceId)) + { + builder.Append(" resourceId: "); + builder.AppendLine($"'{ResourceId.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(CustomInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + CustomInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoProperties.cs new file mode 100644 index 000000000000..70468866dcf2 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/CustomInfoProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Custom image information. + internal partial class CustomInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource id of the custom image. + /// is null. + public CustomInfoProperties(ResourceIdentifier resourceId) + { + Argument.AssertNotNull(resourceId, nameof(resourceId)); + + ResourceId = resourceId; + } + + /// Initializes a new instance of . + /// The resource id of the custom image. + /// Keeps track of any properties unknown to the library. + internal CustomInfoProperties(ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CustomInfoProperties() + { + } + + /// The resource id of the custom image. + [WirePath("resourceId")] + public ResourceIdentifier ResourceId { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DirectUDP.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DirectUDP.cs new file mode 100644 index 000000000000..85ae7021d9ad --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DirectUDP.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + public readonly partial struct DirectUDP : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DirectUDP(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Default. + public static DirectUDP Default { get; } = new DirectUDP(DefaultValue); + /// Enabled. + public static DirectUDP Enabled { get; } = new DirectUDP(EnabledValue); + /// Disabled. + public static DirectUDP Disabled { get; } = new DirectUDP(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DirectUDP left, DirectUDP right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DirectUDP left, DirectUDP right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DirectUDP(string value) => new DirectUDP(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DirectUDP other && Equals(other); + /// + public bool Equals(DirectUDP other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..8afa25a25579 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class DiskInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VirtualMachineDiskType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(VirtualMachineDiskType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskInfoPatchProperties(document.RootElement, options); + } + + internal static DiskInfoPatchProperties DeserializeDiskInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualMachineDiskType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new VirtualMachineDiskType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskInfoPatchProperties(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DiskInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + DiskInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoPatchProperties.cs new file mode 100644 index 000000000000..d4557c206166 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoPatchProperties.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Disk information. + internal partial class DiskInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DiskInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// The disk type used by virtual machine in hostpool session host. + /// Keeps track of any properties unknown to the library. + internal DiskInfoPatchProperties(VirtualMachineDiskType? virtualMachineDiskType, IDictionary serializedAdditionalRawData) + { + VirtualMachineDiskType = virtualMachineDiskType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disk type used by virtual machine in hostpool session host. + [WirePath("type")] + public VirtualMachineDiskType? VirtualMachineDiskType { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoProperties.Serialization.cs new file mode 100644 index 000000000000..fd715ee9dfce --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoProperties.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class DiskInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(VirtualMachineDiskType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskInfoProperties(document.RootElement, options); + } + + internal static DiskInfoProperties DeserializeDiskInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualMachineDiskType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new VirtualMachineDiskType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskInfoProperties(type, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VirtualMachineDiskType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" type: "); + builder.AppendLine($"'{VirtualMachineDiskType.ToString()}'"); + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DiskInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + DiskInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDiskInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoProperties.cs new file mode 100644 index 000000000000..7d1f9ef5f8b6 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DiskInfoProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Disk information. + public partial class DiskInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The disk type used by virtual machine in hostpool session host. + public DiskInfoProperties(VirtualMachineDiskType virtualMachineDiskType) + { + VirtualMachineDiskType = virtualMachineDiskType; + } + + /// Initializes a new instance of . + /// The disk type used by virtual machine in hostpool session host. + /// Keeps track of any properties unknown to the library. + internal DiskInfoProperties(VirtualMachineDiskType virtualMachineDiskType, IDictionary serializedAdditionalRawData) + { + VirtualMachineDiskType = virtualMachineDiskType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiskInfoProperties() + { + } + + /// The disk type used by virtual machine in hostpool session host. + [WirePath("type")] + public VirtualMachineDiskType VirtualMachineDiskType { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..058ba328ed36 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoPatchProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class DomainInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DomainInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ActiveDirectoryInfo)) + { + writer.WritePropertyName("activeDirectoryInfo"u8); + writer.WriteObjectValue(ActiveDirectoryInfo, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DomainInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DomainInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDomainInfoPatchProperties(document.RootElement, options); + } + + internal static DomainInfoPatchProperties DeserializeDomainInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ActiveDirectoryInfoPatchProperties activeDirectoryInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeDirectoryInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeDirectoryInfo = ActiveDirectoryInfoPatchProperties.DeserializeActiveDirectoryInfoPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DomainInfoPatchProperties(activeDirectoryInfo, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DomainInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + DomainInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDomainInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DomainInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoPatchProperties.cs new file mode 100644 index 000000000000..d7d6fe7b6f36 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoPatchProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Domain configurations of session hosts. + internal partial class DomainInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DomainInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// Active directory info. Only one should be populated based on the join type. + /// Keeps track of any properties unknown to the library. + internal DomainInfoPatchProperties(ActiveDirectoryInfoPatchProperties activeDirectoryInfo, IDictionary serializedAdditionalRawData) + { + ActiveDirectoryInfo = activeDirectoryInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Active directory info. Only one should be populated based on the join type. + internal ActiveDirectoryInfoPatchProperties ActiveDirectoryInfo { get; set; } + /// Credentials needed to create the virtual machine. + [WirePath("activeDirectoryInfo.domainCredentials")] + public KeyVaultCredentialsPatchProperties ActiveDirectoryInfoDomainCredentials + { + get => ActiveDirectoryInfo is null ? default : ActiveDirectoryInfo.DomainCredentials; + set + { + if (ActiveDirectoryInfo is null) + ActiveDirectoryInfo = new ActiveDirectoryInfoPatchProperties(); + ActiveDirectoryInfo.DomainCredentials = value; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoProperties.Serialization.cs new file mode 100644 index 000000000000..e95ce9a3bf37 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoProperties.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class DomainInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DomainInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("joinType"u8); + writer.WriteStringValue(JoinType.ToString()); + if (Optional.IsDefined(ActiveDirectoryInfo)) + { + writer.WritePropertyName("activeDirectoryInfo"u8); + writer.WriteObjectValue(ActiveDirectoryInfo, options); + } + if (Optional.IsDefined(AzureActiveDirectoryInfo)) + { + writer.WritePropertyName("azureActiveDirectoryInfo"u8); + writer.WriteObjectValue(AzureActiveDirectoryInfo, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DomainInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DomainInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDomainInfoProperties(document.RootElement, options); + } + + internal static DomainInfoProperties DeserializeDomainInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DomainJoinType joinType = default; + ActiveDirectoryInfoProperties activeDirectoryInfo = default; + AzureActiveDirectoryInfoProperties azureActiveDirectoryInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("joinType"u8)) + { + joinType = new DomainJoinType(property.Value.GetString()); + continue; + } + if (property.NameEquals("activeDirectoryInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeDirectoryInfo = ActiveDirectoryInfoProperties.DeserializeActiveDirectoryInfoProperties(property.Value, options); + continue; + } + if (property.NameEquals("azureActiveDirectoryInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azureActiveDirectoryInfo = AzureActiveDirectoryInfoProperties.DeserializeAzureActiveDirectoryInfoProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DomainInfoProperties(joinType, activeDirectoryInfo, azureActiveDirectoryInfo, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(JoinType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" joinType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" joinType: "); + builder.AppendLine($"'{JoinType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ActiveDirectoryInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" activeDirectoryInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ActiveDirectoryInfo)) + { + builder.Append(" activeDirectoryInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, ActiveDirectoryInfo, options, 2, false, " activeDirectoryInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("AzureActiveDirectoryInfoMdmProviderGuid", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" azureActiveDirectoryInfo: "); + builder.AppendLine("{"); + builder.Append(" mdmProviderGuid: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(AzureActiveDirectoryInfo)) + { + builder.Append(" azureActiveDirectoryInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, AzureActiveDirectoryInfo, options, 2, false, " azureActiveDirectoryInfo: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(DomainInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + DomainInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeDomainInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DomainInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoProperties.cs new file mode 100644 index 000000000000..1f3d319e07ee --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainInfoProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Domain configurations of session hosts. + public partial class DomainInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of domain join done by the virtual machine. + public DomainInfoProperties(DomainJoinType joinType) + { + JoinType = joinType; + } + + /// Initializes a new instance of . + /// The type of domain join done by the virtual machine. + /// Active directory info. Only one should be populated based on the join type. + /// Azure active directory info. Only one should be populated based on the join type. + /// Keeps track of any properties unknown to the library. + internal DomainInfoProperties(DomainJoinType joinType, ActiveDirectoryInfoProperties activeDirectoryInfo, AzureActiveDirectoryInfoProperties azureActiveDirectoryInfo, IDictionary serializedAdditionalRawData) + { + JoinType = joinType; + ActiveDirectoryInfo = activeDirectoryInfo; + AzureActiveDirectoryInfo = azureActiveDirectoryInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DomainInfoProperties() + { + } + + /// The type of domain join done by the virtual machine. + [WirePath("joinType")] + public DomainJoinType JoinType { get; set; } + /// Active directory info. Only one should be populated based on the join type. + [WirePath("activeDirectoryInfo")] + public ActiveDirectoryInfoProperties ActiveDirectoryInfo { get; set; } + /// Azure active directory info. Only one should be populated based on the join type. + internal AzureActiveDirectoryInfoProperties AzureActiveDirectoryInfo { get; set; } + /// The Mobile Device Management(MDM) guid. + [WirePath("azureActiveDirectoryInfo.mdmProviderGuid")] + public string AzureActiveDirectoryInfoMdmProviderGuid + { + get => AzureActiveDirectoryInfo is null ? default : AzureActiveDirectoryInfo.MdmProviderGuid; + set => AzureActiveDirectoryInfo = new AzureActiveDirectoryInfoProperties(value); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainJoinType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainJoinType.cs new file mode 100644 index 000000000000..3a2654ab8f99 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/DomainJoinType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The type of domain join done by the virtual machine. + public readonly partial struct DomainJoinType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DomainJoinType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveDirectoryValue = "ActiveDirectory"; + private const string AzureActiveDirectoryValue = "AzureActiveDirectory"; + + /// Using microsoft active directory. + public static DomainJoinType ActiveDirectory { get; } = new DomainJoinType(ActiveDirectoryValue); + /// Using microsoft azure active directory. + public static DomainJoinType AzureActiveDirectory { get; } = new DomainJoinType(AzureActiveDirectoryValue); + /// Determines if two values are the same. + public static bool operator ==(DomainJoinType left, DomainJoinType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DomainJoinType left, DomainJoinType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DomainJoinType(string value) => new DomainJoinType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DomainJoinType other && Equals(other); + /// + public bool Equals(DomainJoinType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ExpandMsixImage.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ExpandMsixImage.cs index a98a0a7c4bd2..8d55903b49bf 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ExpandMsixImage.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ExpandMsixImage.cs @@ -69,7 +69,7 @@ public ExpandMsixImage() /// Specifies how to register Package in feed. /// Make this version of the package the active one across the hostpool. /// List of package dependencies. - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. /// Date Package was last updated, found in the appxmanifest.xml. /// List of package applications. /// Certificate name found in the appxmanifest.xml. @@ -125,7 +125,7 @@ internal ExpandMsixImage(ResourceIdentifier id, string name, ResourceType resour /// List of package dependencies. [WirePath("properties.packageDependencies")] public IList PackageDependencies { get; set; } - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. [WirePath("properties.version")] public string Version { get; set; } /// Date Package was last updated, found in the appxmanifest.xml. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolLoadBalancerType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolLoadBalancerType.cs index a8d49eeaf110..aadc129c8ecf 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolLoadBalancerType.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolLoadBalancerType.cs @@ -25,6 +25,7 @@ public HostPoolLoadBalancerType(string value) private const string BreadthFirstValue = "BreadthFirst"; private const string DepthFirstValue = "DepthFirst"; private const string PersistentValue = "Persistent"; + private const string MultiplePersistentValue = "MultiplePersistent"; /// BreadthFirst. public static HostPoolLoadBalancerType BreadthFirst { get; } = new HostPoolLoadBalancerType(BreadthFirstValue); @@ -32,6 +33,8 @@ public HostPoolLoadBalancerType(string value) public static HostPoolLoadBalancerType DepthFirst { get; } = new HostPoolLoadBalancerType(DepthFirstValue); /// Persistent. public static HostPoolLoadBalancerType Persistent { get; } = new HostPoolLoadBalancerType(PersistentValue); + /// MultiplePersistent. + public static HostPoolLoadBalancerType MultiplePersistent { get; } = new HostPoolLoadBalancerType(MultiplePersistentValue); /// Determines if two values are the same. public static bool operator ==(HostPoolLoadBalancerType left, HostPoolLoadBalancerType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs index ffdb514a41e8..b3c06713422a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.Serialization.cs @@ -201,15 +201,28 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } if (Optional.IsDefined(AgentUpdate)) { - if (AgentUpdate != null) - { - writer.WritePropertyName("agentUpdate"u8); - writer.WriteObjectValue(AgentUpdate, options); - } - else - { - writer.WriteNull("agentUpdate"); - } + writer.WritePropertyName("agentUpdate"u8); + writer.WriteObjectValue(AgentUpdate, options); + } + if (Optional.IsDefined(ManagedPrivateUDP)) + { + writer.WritePropertyName("managedPrivateUDP"u8); + writer.WriteStringValue(ManagedPrivateUDP.Value.ToString()); + } + if (Optional.IsDefined(DirectUDP)) + { + writer.WritePropertyName("directUDP"u8); + writer.WriteStringValue(DirectUDP.Value.ToString()); + } + if (Optional.IsDefined(PublicUDP)) + { + writer.WritePropertyName("publicUDP"u8); + writer.WriteStringValue(PublicUDP.Value.ToString()); + } + if (Optional.IsDefined(RelayUDP)) + { + writer.WritePropertyName("relayUDP"u8); + writer.WriteStringValue(RelayUDP.Value.ToString()); } writer.WriteEndObject(); } @@ -257,6 +270,10 @@ internal static HostPoolPatch DeserializeHostPoolPatch(JsonElement element, Mode bool? startVmOnConnect = default; HostPoolPublicNetworkAccess? publicNetworkAccess = default; SessionHostAgentUpdatePatchProperties agentUpdate = default; + ManagedPrivateUDP? managedPrivateUDP = default; + DirectUDP? directUDP = default; + PublicUDP? publicUDP = default; + RelayUDP? relayUDP = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -446,12 +463,47 @@ internal static HostPoolPatch DeserializeHostPoolPatch(JsonElement element, Mode { if (property0.Value.ValueKind == JsonValueKind.Null) { - agentUpdate = null; continue; } agentUpdate = SessionHostAgentUpdatePatchProperties.DeserializeSessionHostAgentUpdatePatchProperties(property0.Value, options); continue; } + if (property0.NameEquals("managedPrivateUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedPrivateUDP = new ManagedPrivateUDP(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("directUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + directUDP = new DirectUDP(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("publicUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicUDP = new PublicUDP(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("relayUDP"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + relayUDP = new RelayUDP(property0.Value.GetString()); + continue; + } } continue; } @@ -485,6 +537,10 @@ internal static HostPoolPatch DeserializeHostPoolPatch(JsonElement element, Mode startVmOnConnect, publicNetworkAccess, agentUpdate, + managedPrivateUDP, + directUDP, + publicUDP, + relayUDP, serializedAdditionalRawData); } @@ -919,6 +975,66 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ManagedPrivateUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" managedPrivateUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ManagedPrivateUDP)) + { + builder.Append(" managedPrivateUDP: "); + builder.AppendLine($"'{ManagedPrivateUDP.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DirectUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" directUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DirectUDP)) + { + builder.Append(" directUDP: "); + builder.AppendLine($"'{DirectUDP.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PublicUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publicUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublicUDP)) + { + builder.Append(" publicUDP: "); + builder.AppendLine($"'{PublicUDP.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RelayUDP), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" relayUDP: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RelayUDP)) + { + builder.Append(" relayUDP: "); + builder.AppendLine($"'{RelayUDP.Value.ToString()}'"); + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs index 06ea79401754..4a29c789cf74 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolPatch.cs @@ -67,7 +67,7 @@ public HostPoolPatch() /// The type of the load balancer. /// The ring number of HostPool. /// Is validation environment. - /// The registration info of HostPool. + /// The registration info of HostPool. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. /// VM template for sessionhosts configuration within hostpool. /// URL to customer ADFS server for signing WVD SSO certificates. /// ClientId for the registered Relying Party used to issue WVD SSO certificates. @@ -77,8 +77,12 @@ public HostPoolPatch() /// The flag to turn on/off StartVMOnConnect feature. /// Enabled to allow this resource to be access from the public network. /// The session host configuration for updating agent, monitoring agent, and stack component. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. /// Keeps track of any properties unknown to the library. - internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdatePatchProperties agentUpdate, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, string friendlyName, string description, string customRdpProperty, int? maxSessionLimit, PersonalDesktopAssignmentType? personalDesktopAssignmentType, HostPoolLoadBalancerType? loadBalancerType, int? ring, bool? isValidationEnvironment, HostPoolRegistrationInfoPatch registrationInfo, string vmTemplate, string ssoAdfsAuthority, string ssoClientId, string ssoClientSecretKeyVaultPath, HostPoolSsoSecretType? ssoSecretType, PreferredAppGroupType? preferredAppGroupType, bool? startVmOnConnect, HostPoolPublicNetworkAccess? publicNetworkAccess, SessionHostAgentUpdatePatchProperties agentUpdate, ManagedPrivateUDP? managedPrivateUDP, DirectUDP? directUDP, PublicUDP? publicUDP, RelayUDP? relayUDP, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Tags = tags; FriendlyName = friendlyName; @@ -99,6 +103,10 @@ internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resource StartVmOnConnect = startVmOnConnect; PublicNetworkAccess = publicNetworkAccess; AgentUpdate = agentUpdate; + ManagedPrivateUDP = managedPrivateUDP; + DirectUDP = directUDP; + PublicUDP = publicUDP; + RelayUDP = relayUDP; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -129,7 +137,7 @@ internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resource /// Is validation environment. [WirePath("properties.validationEnvironment")] public bool? IsValidationEnvironment { get; set; } - /// The registration info of HostPool. + /// The registration info of HostPool. This is not returned on GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. [WirePath("properties.registrationInfo")] public HostPoolRegistrationInfoPatch RegistrationInfo { get; set; } /// VM template for sessionhosts configuration within hostpool. @@ -159,5 +167,17 @@ internal HostPoolPatch(ResourceIdentifier id, string name, ResourceType resource /// The session host configuration for updating agent, monitoring agent, and stack component. [WirePath("properties.agentUpdate")] public SessionHostAgentUpdatePatchProperties AgentUpdate { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.managedPrivateUDP")] + public ManagedPrivateUDP? ManagedPrivateUDP { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.directUDP")] + public DirectUDP? DirectUDP { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.publicUDP")] + public PublicUDP? PublicUDP { get; set; } + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + [WirePath("properties.relayUDP")] + public RelayUDP? RelayUDP { get; set; } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfo.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfo.cs index a8e0b92a25e6..3813827ef833 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfo.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfo.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.DesktopVirtualization.Models { - /// Represents a RegistrationInfo definition. + /// Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. public partial class HostPoolRegistrationInfo { /// diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfoPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfoPatch.cs index fb710aee8187..7cca966fda6f 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfoPatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolRegistrationInfoPatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.DesktopVirtualization.Models { - /// Represents a RegistrationInfo definition. + /// Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST calls. public partial class HostPoolRegistrationInfoPatch { /// diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateAction.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateAction.cs new file mode 100644 index 000000000000..921aaf071c64 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateAction.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Action types for controlling hostpool update. + public readonly partial struct HostPoolUpdateAction : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HostPoolUpdateAction(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartValue = "Start"; + private const string PauseValue = "Pause"; + private const string CancelValue = "Cancel"; + private const string RetryValue = "Retry"; + private const string ResumeValue = "Resume"; + + /// Start the hostpool update. + public static HostPoolUpdateAction Start { get; } = new HostPoolUpdateAction(StartValue); + /// Pause the hostpool update. + public static HostPoolUpdateAction Pause { get; } = new HostPoolUpdateAction(PauseValue); + /// Cancel the hostpool update. + public static HostPoolUpdateAction Cancel { get; } = new HostPoolUpdateAction(CancelValue); + /// Retry the hostpool update. + public static HostPoolUpdateAction Retry { get; } = new HostPoolUpdateAction(RetryValue); + /// Resume the hostpool update. + public static HostPoolUpdateAction Resume { get; } = new HostPoolUpdateAction(ResumeValue); + /// Determines if two values are the same. + public static bool operator ==(HostPoolUpdateAction left, HostPoolUpdateAction right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HostPoolUpdateAction left, HostPoolUpdateAction right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator HostPoolUpdateAction(string value) => new HostPoolUpdateAction(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HostPoolUpdateAction other && Equals(other); + /// + public bool Equals(HostPoolUpdateAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationPatchProperties.Serialization.cs new file mode 100644 index 000000000000..70c95eb3a25a --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationPatchProperties.Serialization.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class HostPoolUpdateConfigurationPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeleteOriginalVm)) + { + writer.WritePropertyName("deleteOriginalVm"u8); + writer.WriteBooleanValue(DeleteOriginalVm.Value); + } + if (Optional.IsDefined(MaxVmsRemoved)) + { + writer.WritePropertyName("maxVmsRemoved"u8); + writer.WriteNumberValue(MaxVmsRemoved.Value); + } + if (Optional.IsDefined(LogOffDelayMinutes)) + { + writer.WritePropertyName("logOffDelayMinutes"u8); + writer.WriteNumberValue(LogOffDelayMinutes.Value); + } + if (Optional.IsDefined(LogOffMessage)) + { + writer.WritePropertyName("logOffMessage"u8); + writer.WriteStringValue(LogOffMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HostPoolUpdateConfigurationPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHostPoolUpdateConfigurationPatchProperties(document.RootElement, options); + } + + internal static HostPoolUpdateConfigurationPatchProperties DeserializeHostPoolUpdateConfigurationPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? deleteOriginalVm = default; + int? maxVmsRemoved = default; + int? logOffDelayMinutes = default; + string logOffMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deleteOriginalVm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOriginalVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("maxVmsRemoved"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxVmsRemoved = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("logOffDelayMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logOffDelayMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("logOffMessage"u8)) + { + logOffMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HostPoolUpdateConfigurationPatchProperties(deleteOriginalVm, maxVmsRemoved, logOffDelayMinutes, logOffMessage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + HostPoolUpdateConfigurationPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHostPoolUpdateConfigurationPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationPatchProperties.cs new file mode 100644 index 000000000000..e4ff4f7277cb --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationPatchProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The configurations of a hostpool update. + public partial class HostPoolUpdateConfigurationPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public HostPoolUpdateConfigurationPatchProperties() + { + } + + /// Initializes a new instance of . + /// Whether not to save original disk. False by default. + /// The maximum number of virtual machines to be removed during hostpool update. + /// Grace period before logging off users in minutes. + /// Log off message sent to user for logoff. + /// Keeps track of any properties unknown to the library. + internal HostPoolUpdateConfigurationPatchProperties(bool? deleteOriginalVm, int? maxVmsRemoved, int? logOffDelayMinutes, string logOffMessage, IDictionary serializedAdditionalRawData) + { + DeleteOriginalVm = deleteOriginalVm; + MaxVmsRemoved = maxVmsRemoved; + LogOffDelayMinutes = logOffDelayMinutes; + LogOffMessage = logOffMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether not to save original disk. False by default. + [WirePath("deleteOriginalVm")] + public bool? DeleteOriginalVm { get; set; } + /// The maximum number of virtual machines to be removed during hostpool update. + [WirePath("maxVmsRemoved")] + public int? MaxVmsRemoved { get; set; } + /// Grace period before logging off users in minutes. + [WirePath("logOffDelayMinutes")] + public int? LogOffDelayMinutes { get; set; } + /// Log off message sent to user for logoff. + [WirePath("logOffMessage")] + public string LogOffMessage { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..eb878241c9e8 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationProperties.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class HostPoolUpdateConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeleteOriginalVm)) + { + writer.WritePropertyName("deleteOriginalVm"u8); + writer.WriteBooleanValue(DeleteOriginalVm.Value); + } + writer.WritePropertyName("maxVmsRemoved"u8); + writer.WriteNumberValue(MaxVmsRemoved); + writer.WritePropertyName("logOffDelayMinutes"u8); + writer.WriteNumberValue(LogOffDelayMinutes); + if (Optional.IsDefined(LogOffMessage)) + { + writer.WritePropertyName("logOffMessage"u8); + writer.WriteStringValue(LogOffMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HostPoolUpdateConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHostPoolUpdateConfigurationProperties(document.RootElement, options); + } + + internal static HostPoolUpdateConfigurationProperties DeserializeHostPoolUpdateConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? deleteOriginalVm = default; + int maxVmsRemoved = default; + int logOffDelayMinutes = default; + string logOffMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deleteOriginalVm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOriginalVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("maxVmsRemoved"u8)) + { + maxVmsRemoved = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("logOffDelayMinutes"u8)) + { + logOffDelayMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("logOffMessage"u8)) + { + logOffMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HostPoolUpdateConfigurationProperties(deleteOriginalVm, maxVmsRemoved, logOffDelayMinutes, logOffMessage, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeleteOriginalVm), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" deleteOriginalVm: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeleteOriginalVm)) + { + builder.Append(" deleteOriginalVm: "); + var boolValue = DeleteOriginalVm.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaxVmsRemoved), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maxVmsRemoved: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" maxVmsRemoved: "); + builder.AppendLine($"{MaxVmsRemoved}"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogOffDelayMinutes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logOffDelayMinutes: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" logOffDelayMinutes: "); + builder.AppendLine($"{LogOffDelayMinutes}"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LogOffMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" logOffMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LogOffMessage)) + { + builder.Append(" logOffMessage: "); + if (LogOffMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LogOffMessage}'''"); + } + else + { + builder.AppendLine($"'{LogOffMessage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + HostPoolUpdateConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHostPoolUpdateConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HostPoolUpdateConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationProperties.cs new file mode 100644 index 000000000000..8dcab828eefd --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateConfigurationProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The configurations of a hostpool update. + public partial class HostPoolUpdateConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The maximum number of virtual machines to be removed during hostpool update. + /// Grace period before logging off users in minutes. + public HostPoolUpdateConfigurationProperties(int maxVmsRemoved, int logOffDelayMinutes) + { + MaxVmsRemoved = maxVmsRemoved; + LogOffDelayMinutes = logOffDelayMinutes; + } + + /// Initializes a new instance of . + /// Whether not to save original disk. False by default. + /// The maximum number of virtual machines to be removed during hostpool update. + /// Grace period before logging off users in minutes. + /// Log off message sent to user for logoff. Default value is an empty string. + /// Keeps track of any properties unknown to the library. + internal HostPoolUpdateConfigurationProperties(bool? deleteOriginalVm, int maxVmsRemoved, int logOffDelayMinutes, string logOffMessage, IDictionary serializedAdditionalRawData) + { + DeleteOriginalVm = deleteOriginalVm; + MaxVmsRemoved = maxVmsRemoved; + LogOffDelayMinutes = logOffDelayMinutes; + LogOffMessage = logOffMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HostPoolUpdateConfigurationProperties() + { + } + + /// Whether not to save original disk. False by default. + [WirePath("deleteOriginalVm")] + public bool? DeleteOriginalVm { get; set; } + /// The maximum number of virtual machines to be removed during hostpool update. + [WirePath("maxVmsRemoved")] + public int MaxVmsRemoved { get; set; } + /// Grace period before logging off users in minutes. + [WirePath("logOffDelayMinutes")] + public int LogOffDelayMinutes { get; set; } + /// Log off message sent to user for logoff. Default value is an empty string. + [WirePath("logOffMessage")] + public string LogOffMessage { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateControlParameter.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateControlParameter.Serialization.cs new file mode 100644 index 000000000000..a29d5c5c296c --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateControlParameter.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class HostPoolUpdateControlParameter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HostPoolUpdateControlParameter)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("action"u8); + writer.WriteStringValue(Action.ToString()); + if (Optional.IsDefined(CancelMessage)) + { + writer.WritePropertyName("cancelMessage"u8); + writer.WriteStringValue(CancelMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HostPoolUpdateControlParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HostPoolUpdateControlParameter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHostPoolUpdateControlParameter(document.RootElement, options); + } + + internal static HostPoolUpdateControlParameter DeserializeHostPoolUpdateControlParameter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HostPoolUpdateAction action = default; + string cancelMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("action"u8)) + { + action = new HostPoolUpdateAction(property.Value.GetString()); + continue; + } + if (property.NameEquals("cancelMessage"u8)) + { + cancelMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HostPoolUpdateControlParameter(action, cancelMessage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HostPoolUpdateControlParameter)} does not support writing '{options.Format}' format."); + } + } + + HostPoolUpdateControlParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeHostPoolUpdateControlParameter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HostPoolUpdateControlParameter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateControlParameter.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateControlParameter.cs new file mode 100644 index 000000000000..8a685f2dbb32 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/HostPoolUpdateControlParameter.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Represents properties for a hostpool update control request. + public partial class HostPoolUpdateControlParameter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Action types for controlling hostpool update. + public HostPoolUpdateControlParameter(HostPoolUpdateAction action) + { + Action = action; + } + + /// Initializes a new instance of . + /// Action types for controlling hostpool update. + /// The cancel message sent to the user on the session host. This is can only be specified if the action is 'Cancel'. + /// Keeps track of any properties unknown to the library. + internal HostPoolUpdateControlParameter(HostPoolUpdateAction action, string cancelMessage, IDictionary serializedAdditionalRawData) + { + Action = action; + CancelMessage = cancelMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HostPoolUpdateControlParameter() + { + } + + /// Action types for controlling hostpool update. + [WirePath("action")] + public HostPoolUpdateAction Action { get; } + /// The cancel message sent to the user on the session host. This is can only be specified if the action is 'Cancel'. + [WirePath("cancelMessage")] + public string CancelMessage { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..9a9d121527ad --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoPatchProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class ImageInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ImageType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ImageType.Value.ToString()); + } + if (Optional.IsDefined(MarketplaceInfo)) + { + writer.WritePropertyName("marketplaceInfo"u8); + writer.WriteObjectValue(MarketplaceInfo, options); + } + if (Optional.IsDefined(CustomInfo)) + { + writer.WritePropertyName("customInfo"u8); + writer.WriteObjectValue(CustomInfo, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageInfoPatchProperties(document.RootElement, options); + } + + internal static ImageInfoPatchProperties DeserializeImageInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Type? type = default; + MarketplaceInfoPatchProperties marketplaceInfo = default; + CustomInfoPatchProperties customInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new Type(property.Value.GetString()); + continue; + } + if (property.NameEquals("marketplaceInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceInfo = MarketplaceInfoPatchProperties.DeserializeMarketplaceInfoPatchProperties(property.Value, options); + continue; + } + if (property.NameEquals("customInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customInfo = CustomInfoPatchProperties.DeserializeCustomInfoPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageInfoPatchProperties(type, marketplaceInfo, customInfo, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ImageInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + ImageInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoPatchProperties.cs new file mode 100644 index 000000000000..59718dfc366c --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoPatchProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Image configurations of session host in a HostPool. + public partial class ImageInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ImageInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// The type of image session hosts use in the hostpool. + /// The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + /// The values to uniquely identify a custom image. Only one should be populated based on the image type. + /// Keeps track of any properties unknown to the library. + internal ImageInfoPatchProperties(Type? imageType, MarketplaceInfoPatchProperties marketplaceInfo, CustomInfoPatchProperties customInfo, IDictionary serializedAdditionalRawData) + { + ImageType = imageType; + MarketplaceInfo = marketplaceInfo; + CustomInfo = customInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of image session hosts use in the hostpool. + [WirePath("type")] + public Type? ImageType { get; set; } + /// The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + [WirePath("marketplaceInfo")] + public MarketplaceInfoPatchProperties MarketplaceInfo { get; set; } + /// The values to uniquely identify a custom image. Only one should be populated based on the image type. + internal CustomInfoPatchProperties CustomInfo { get; set; } + /// The resource id of the custom image. + [WirePath("customInfo.resourceId")] + public ResourceIdentifier CustomInfoResourceId + { + get => CustomInfo is null ? default : CustomInfo.ResourceId; + set + { + if (CustomInfo is null) + CustomInfo = new CustomInfoPatchProperties(); + CustomInfo.ResourceId = value; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoProperties.Serialization.cs new file mode 100644 index 000000000000..069d4372a596 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoProperties.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class ImageInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ImageType.ToString()); + if (Optional.IsDefined(MarketplaceInfo)) + { + writer.WritePropertyName("marketplaceInfo"u8); + writer.WriteObjectValue(MarketplaceInfo, options); + } + if (Optional.IsDefined(CustomInfo)) + { + writer.WritePropertyName("customInfo"u8); + writer.WriteObjectValue(CustomInfo, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ImageInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageInfoProperties(document.RootElement, options); + } + + internal static ImageInfoProperties DeserializeImageInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Type type = default; + MarketplaceInfoProperties marketplaceInfo = default; + CustomInfoProperties customInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new Type(property.Value.GetString()); + continue; + } + if (property.NameEquals("marketplaceInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + marketplaceInfo = MarketplaceInfoProperties.DeserializeMarketplaceInfoProperties(property.Value, options); + continue; + } + if (property.NameEquals("customInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customInfo = CustomInfoProperties.DeserializeCustomInfoProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageInfoProperties(type, marketplaceInfo, customInfo, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImageType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" type: "); + builder.AppendLine($"'{ImageType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MarketplaceInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" marketplaceInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MarketplaceInfo)) + { + builder.Append(" marketplaceInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, MarketplaceInfo, options, 2, false, " marketplaceInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CustomInfoResourceId", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customInfo: "); + builder.AppendLine("{"); + builder.Append(" resourceId: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(CustomInfo)) + { + builder.Append(" customInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, CustomInfo, options, 2, false, " customInfo: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(ImageInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + ImageInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeImageInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoProperties.cs new file mode 100644 index 000000000000..f8bdfc9bc206 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ImageInfoProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Image configurations of session host in a HostPool. + public partial class ImageInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of image session hosts use in the hostpool. + public ImageInfoProperties(Type imageType) + { + ImageType = imageType; + } + + /// Initializes a new instance of . + /// The type of image session hosts use in the hostpool. + /// The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + /// The values to uniquely identify a custom image. Only one should be populated based on the image type. + /// Keeps track of any properties unknown to the library. + internal ImageInfoProperties(Type imageType, MarketplaceInfoProperties marketplaceInfo, CustomInfoProperties customInfo, IDictionary serializedAdditionalRawData) + { + ImageType = imageType; + MarketplaceInfo = marketplaceInfo; + CustomInfo = customInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ImageInfoProperties() + { + } + + /// The type of image session hosts use in the hostpool. + [WirePath("type")] + public Type ImageType { get; set; } + /// The values to uniquely identify a marketplace image. Only one should be populated based on the image type. + [WirePath("marketplaceInfo")] + public MarketplaceInfoProperties MarketplaceInfo { get; set; } + /// The values to uniquely identify a custom image. Only one should be populated based on the image type. + internal CustomInfoProperties CustomInfo { get; set; } + /// The resource id of the custom image. + [WirePath("customInfo.resourceId")] + public ResourceIdentifier CustomInfoResourceId + { + get => CustomInfo is null ? default : CustomInfo.ResourceId; + set => CustomInfo = new CustomInfoProperties(value); + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsPatchProperties.Serialization.cs new file mode 100644 index 000000000000..18dc4fb43018 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsPatchProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class KeyVaultCredentialsPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyVaultCredentialsPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(UsernameKeyVaultSecretUri)) + { + writer.WritePropertyName("usernameKeyVaultSecretUri"u8); + writer.WriteStringValue(UsernameKeyVaultSecretUri.AbsoluteUri); + } + if (Optional.IsDefined(PasswordKeyVaultSecretUri)) + { + writer.WritePropertyName("passwordKeyVaultSecretUri"u8); + writer.WriteStringValue(PasswordKeyVaultSecretUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KeyVaultCredentialsPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyVaultCredentialsPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCredentialsPatchProperties(document.RootElement, options); + } + + internal static KeyVaultCredentialsPatchProperties DeserializeKeyVaultCredentialsPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri usernameKeyVaultSecretUri = default; + Uri passwordKeyVaultSecretUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usernameKeyVaultSecretUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + usernameKeyVaultSecretUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("passwordKeyVaultSecretUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + passwordKeyVaultSecretUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeyVaultCredentialsPatchProperties(usernameKeyVaultSecretUri, passwordKeyVaultSecretUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(KeyVaultCredentialsPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + KeyVaultCredentialsPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeKeyVaultCredentialsPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyVaultCredentialsPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsPatchProperties.cs new file mode 100644 index 000000000000..080e123f02dd --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsPatchProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Credentials kept in the keyvault. + public partial class KeyVaultCredentialsPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public KeyVaultCredentialsPatchProperties() + { + } + + /// Initializes a new instance of . + /// The uri to access the secret that the username is stored in. + /// The uri to access the secret that the password is stored in. + /// Keeps track of any properties unknown to the library. + internal KeyVaultCredentialsPatchProperties(Uri usernameKeyVaultSecretUri, Uri passwordKeyVaultSecretUri, IDictionary serializedAdditionalRawData) + { + UsernameKeyVaultSecretUri = usernameKeyVaultSecretUri; + PasswordKeyVaultSecretUri = passwordKeyVaultSecretUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The uri to access the secret that the username is stored in. + [WirePath("usernameKeyVaultSecretUri")] + public Uri UsernameKeyVaultSecretUri { get; set; } + /// The uri to access the secret that the password is stored in. + [WirePath("passwordKeyVaultSecretUri")] + public Uri PasswordKeyVaultSecretUri { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsProperties.Serialization.cs new file mode 100644 index 000000000000..cce1f0f8b1cd --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsProperties.Serialization.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class KeyVaultCredentialsProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyVaultCredentialsProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("usernameKeyVaultSecretUri"u8); + writer.WriteStringValue(UsernameKeyVaultSecretUri.AbsoluteUri); + writer.WritePropertyName("passwordKeyVaultSecretUri"u8); + writer.WriteStringValue(PasswordKeyVaultSecretUri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + KeyVaultCredentialsProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(KeyVaultCredentialsProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeKeyVaultCredentialsProperties(document.RootElement, options); + } + + internal static KeyVaultCredentialsProperties DeserializeKeyVaultCredentialsProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri usernameKeyVaultSecretUri = default; + Uri passwordKeyVaultSecretUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("usernameKeyVaultSecretUri"u8)) + { + usernameKeyVaultSecretUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("passwordKeyVaultSecretUri"u8)) + { + passwordKeyVaultSecretUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new KeyVaultCredentialsProperties(usernameKeyVaultSecretUri, passwordKeyVaultSecretUri, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UsernameKeyVaultSecretUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" usernameKeyVaultSecretUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UsernameKeyVaultSecretUri)) + { + builder.Append(" usernameKeyVaultSecretUri: "); + builder.AppendLine($"'{UsernameKeyVaultSecretUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PasswordKeyVaultSecretUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" passwordKeyVaultSecretUri: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PasswordKeyVaultSecretUri)) + { + builder.Append(" passwordKeyVaultSecretUri: "); + builder.AppendLine($"'{PasswordKeyVaultSecretUri.AbsoluteUri}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(KeyVaultCredentialsProperties)} does not support writing '{options.Format}' format."); + } + } + + KeyVaultCredentialsProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeKeyVaultCredentialsProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(KeyVaultCredentialsProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsProperties.cs new file mode 100644 index 000000000000..5d3948bfd0d9 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/KeyVaultCredentialsProperties.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Credentials kept in the keyvault. + public partial class KeyVaultCredentialsProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The uri to access the secret that the username is stored in. + /// The uri to access the secret that the password is stored in. + /// or is null. + public KeyVaultCredentialsProperties(Uri usernameKeyVaultSecretUri, Uri passwordKeyVaultSecretUri) + { + Argument.AssertNotNull(usernameKeyVaultSecretUri, nameof(usernameKeyVaultSecretUri)); + Argument.AssertNotNull(passwordKeyVaultSecretUri, nameof(passwordKeyVaultSecretUri)); + + UsernameKeyVaultSecretUri = usernameKeyVaultSecretUri; + PasswordKeyVaultSecretUri = passwordKeyVaultSecretUri; + } + + /// Initializes a new instance of . + /// The uri to access the secret that the username is stored in. + /// The uri to access the secret that the password is stored in. + /// Keeps track of any properties unknown to the library. + internal KeyVaultCredentialsProperties(Uri usernameKeyVaultSecretUri, Uri passwordKeyVaultSecretUri, IDictionary serializedAdditionalRawData) + { + UsernameKeyVaultSecretUri = usernameKeyVaultSecretUri; + PasswordKeyVaultSecretUri = passwordKeyVaultSecretUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal KeyVaultCredentialsProperties() + { + } + + /// The uri to access the secret that the username is stored in. + [WirePath("usernameKeyVaultSecretUri")] + public Uri UsernameKeyVaultSecretUri { get; set; } + /// The uri to access the secret that the password is stored in. + [WirePath("passwordKeyVaultSecretUri")] + public Uri PasswordKeyVaultSecretUri { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ManagedPrivateUDP.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ManagedPrivateUDP.cs new file mode 100644 index 000000000000..0393cae391b0 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ManagedPrivateUDP.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + public readonly partial struct ManagedPrivateUDP : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPrivateUDP(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Default. + public static ManagedPrivateUDP Default { get; } = new ManagedPrivateUDP(DefaultValue); + /// Enabled. + public static ManagedPrivateUDP Enabled { get; } = new ManagedPrivateUDP(EnabledValue); + /// Disabled. + public static ManagedPrivateUDP Disabled { get; } = new ManagedPrivateUDP(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPrivateUDP left, ManagedPrivateUDP right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPrivateUDP left, ManagedPrivateUDP right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedPrivateUDP(string value) => new ManagedPrivateUDP(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPrivateUDP other && Equals(other); + /// + public bool Equals(ManagedPrivateUDP other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ManagementType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ManagementType.cs new file mode 100644 index 000000000000..f9c558b9f90b --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ManagementType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The type of management for this hostpool, Automated or Standard. The default value is Automated. + public readonly partial struct ManagementType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagementType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutomatedValue = "Automated"; + private const string StandardValue = "Standard"; + + /// Automated. + public static ManagementType Automated { get; } = new ManagementType(AutomatedValue); + /// Standard. + public static ManagementType Standard { get; } = new ManagementType(StandardValue); + /// Determines if two values are the same. + public static bool operator ==(ManagementType left, ManagementType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagementType left, ManagementType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagementType(string value) => new ManagementType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagementType other && Equals(other); + /// + public bool Equals(ManagementType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..ea094684bb25 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoPatchProperties.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class MarketplaceInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(ExactVersion)) + { + writer.WritePropertyName("exactVersion"u8); + writer.WriteStringValue(ExactVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MarketplaceInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceInfoPatchProperties(document.RootElement, options); + } + + internal static MarketplaceInfoPatchProperties DeserializeMarketplaceInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string offer = default; + string publisher = default; + string sku = default; + string exactVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("exactVersion"u8)) + { + exactVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceInfoPatchProperties(offer, publisher, sku, exactVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MarketplaceInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMarketplaceInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoPatchProperties.cs new file mode 100644 index 000000000000..7fad83d45e50 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoPatchProperties.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Marketplace image information. + public partial class MarketplaceInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MarketplaceInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// The offer of the image. + /// The publisher of the image. + /// The sku of the image. + /// The exact version of the image. + /// Keeps track of any properties unknown to the library. + internal MarketplaceInfoPatchProperties(string offer, string publisher, string sku, string exactVersion, IDictionary serializedAdditionalRawData) + { + Offer = offer; + Publisher = publisher; + Sku = sku; + ExactVersion = exactVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The offer of the image. + [WirePath("offer")] + public string Offer { get; set; } + /// The publisher of the image. + [WirePath("publisher")] + public string Publisher { get; set; } + /// The sku of the image. + [WirePath("sku")] + public string Sku { get; set; } + /// The exact version of the image. + [WirePath("exactVersion")] + public string ExactVersion { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoProperties.Serialization.cs new file mode 100644 index 000000000000..dd76cd23f670 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoProperties.Serialization.cs @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class MarketplaceInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + writer.WritePropertyName("exactVersion"u8); + writer.WriteStringValue(ExactVersion); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + MarketplaceInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplaceInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplaceInfoProperties(document.RootElement, options); + } + + internal static MarketplaceInfoProperties DeserializeMarketplaceInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string offer = default; + string publisher = default; + string sku = default; + string exactVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("exactVersion"u8)) + { + exactVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MarketplaceInfoProperties(offer, publisher, sku, exactVersion, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Offer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" offer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Offer)) + { + builder.Append(" offer: "); + if (Offer.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Offer}'''"); + } + else + { + builder.AppendLine($"'{Offer}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Publisher), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publisher: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Publisher)) + { + builder.Append(" publisher: "); + if (Publisher.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Publisher}'''"); + } + else + { + builder.AppendLine($"'{Publisher}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Sku), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sku: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Sku)) + { + builder.Append(" sku: "); + if (Sku.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Sku}'''"); + } + else + { + builder.AppendLine($"'{Sku}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExactVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" exactVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExactVersion)) + { + builder.Append(" exactVersion: "); + if (ExactVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ExactVersion}'''"); + } + else + { + builder.AppendLine($"'{ExactVersion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(MarketplaceInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + MarketplaceInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMarketplaceInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplaceInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoProperties.cs new file mode 100644 index 000000000000..b234d87b2f14 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MarketplaceInfoProperties.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Marketplace image information. + public partial class MarketplaceInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The offer of the image. + /// The publisher of the image. + /// The sku of the image. + /// The exact version of the image. + /// , , or is null. + public MarketplaceInfoProperties(string offer, string publisher, string sku, string exactVersion) + { + Argument.AssertNotNull(offer, nameof(offer)); + Argument.AssertNotNull(publisher, nameof(publisher)); + Argument.AssertNotNull(sku, nameof(sku)); + Argument.AssertNotNull(exactVersion, nameof(exactVersion)); + + Offer = offer; + Publisher = publisher; + Sku = sku; + ExactVersion = exactVersion; + } + + /// Initializes a new instance of . + /// The offer of the image. + /// The publisher of the image. + /// The sku of the image. + /// The exact version of the image. + /// Keeps track of any properties unknown to the library. + internal MarketplaceInfoProperties(string offer, string publisher, string sku, string exactVersion, IDictionary serializedAdditionalRawData) + { + Offer = offer; + Publisher = publisher; + Sku = sku; + ExactVersion = exactVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MarketplaceInfoProperties() + { + } + + /// The offer of the image. + [WirePath("offer")] + public string Offer { get; set; } + /// The publisher of the image. + [WirePath("publisher")] + public string Publisher { get; set; } + /// The sku of the image. + [WirePath("sku")] + public string Sku { get; set; } + /// The exact version of the image. + [WirePath("exactVersion")] + public string ExactVersion { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MsixPackageDependencies.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MsixPackageDependencies.cs index d78459760927..dd81d98dae42 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MsixPackageDependencies.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/MsixPackageDependencies.cs @@ -51,7 +51,7 @@ public MsixPackageDependencies() } /// Initializes a new instance of . - /// Name of package dependency. + /// Name of the package dependency. For Msix packages, this is the other packages this package depends upon, for APP-V packages this is the locations of the user and deployment config files. /// Name of dependency publisher. /// Dependency version required. /// Keeps track of any properties unknown to the library. @@ -63,7 +63,7 @@ internal MsixPackageDependencies(string dependencyName, string publisher, string _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Name of package dependency. + /// Name of the package dependency. For Msix packages, this is the other packages this package depends upon, for APP-V packages this is the locations of the user and deployment config files. [WirePath("dependencyName")] public string DependencyName { get; set; } /// Name of dependency publisher. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..58d20edccc45 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoPatchProperties.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class NetworkInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (Optional.IsDefined(SecurityGroupId)) + { + writer.WritePropertyName("securityGroupId"u8); + writer.WriteStringValue(SecurityGroupId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkInfoPatchProperties(document.RootElement, options); + } + + internal static NetworkInfoPatchProperties DeserializeNetworkInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier subnetId = default; + string securityGroupId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("securityGroupId"u8)) + { + securityGroupId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkInfoPatchProperties(subnetId, securityGroupId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(NetworkInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNetworkInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoPatchProperties.cs new file mode 100644 index 000000000000..aa059281ed78 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoPatchProperties.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Network information. + public partial class NetworkInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public NetworkInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// The resource ID of the subnet. + /// The resource ID of the security group. Any allowable/open ports should be specified in the Network Security Group(NSG). + /// Keeps track of any properties unknown to the library. + internal NetworkInfoPatchProperties(ResourceIdentifier subnetId, string securityGroupId, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + SecurityGroupId = securityGroupId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource ID of the subnet. + [WirePath("subnetId")] + public ResourceIdentifier SubnetId { get; set; } + /// The resource ID of the security group. Any allowable/open ports should be specified in the Network Security Group(NSG). + [WirePath("securityGroupId")] + public string SecurityGroupId { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoProperties.Serialization.cs new file mode 100644 index 000000000000..a8826ec4b9fc --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoProperties.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class NetworkInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInfoProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + if (Optional.IsDefined(SecurityGroupId)) + { + writer.WritePropertyName("securityGroupId"u8); + writer.WriteStringValue(SecurityGroupId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkInfoProperties(document.RootElement, options); + } + + internal static NetworkInfoProperties DeserializeNetworkInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier subnetId = default; + string securityGroupId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("securityGroupId"u8)) + { + securityGroupId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkInfoProperties(subnetId, securityGroupId, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubnetId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subnetId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SubnetId)) + { + builder.Append(" subnetId: "); + builder.AppendLine($"'{SubnetId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityGroupId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityGroupId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityGroupId)) + { + builder.Append(" securityGroupId: "); + if (SecurityGroupId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SecurityGroupId}'''"); + } + else + { + builder.AppendLine($"'{SecurityGroupId}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NetworkInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeNetworkInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoProperties.cs new file mode 100644 index 000000000000..cb541753ee79 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/NetworkInfoProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Network information. + public partial class NetworkInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The resource ID of the subnet. + /// is null. + public NetworkInfoProperties(ResourceIdentifier subnetId) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + + SubnetId = subnetId; + } + + /// Initializes a new instance of . + /// The resource ID of the subnet. + /// The resource ID of the security group. Any allowable/open ports should be specified in the Network Security Group(NSG). + /// Keeps track of any properties unknown to the library. + internal NetworkInfoProperties(ResourceIdentifier subnetId, string securityGroupId, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + SecurityGroupId = securityGroupId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkInfoProperties() + { + } + + /// The resource ID of the subnet. + [WirePath("subnetId")] + public ResourceIdentifier SubnetId { get; set; } + /// The resource ID of the security group. Any allowable/open ports should be specified in the Network Security Group(NSG). + [WirePath("securityGroupId")] + public string SecurityGroupId { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PreferredAppGroupType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PreferredAppGroupType.cs index 2d620a763a20..a0bd450881d0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PreferredAppGroupType.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PreferredAppGroupType.cs @@ -26,11 +26,11 @@ public PreferredAppGroupType(string value) private const string DesktopValue = "Desktop"; private const string RailApplicationsValue = "RailApplications"; - /// None. + /// This value is read only, it is not accepted on input. public static PreferredAppGroupType None { get; } = new PreferredAppGroupType(NoneValue); - /// Desktop. + /// Users access the full Windows desktop from a session host. Available with pooled or personal host pools. public static PreferredAppGroupType Desktop { get; } = new PreferredAppGroupType(DesktopValue); - /// RailApplications. + /// Users access individual applications you select and publish to the application group. Available with pooled host pools only. public static PreferredAppGroupType RailApplications { get; } = new PreferredAppGroupType(RailApplicationsValue); /// Determines if two values are the same. public static bool operator ==(PreferredAppGroupType left, PreferredAppGroupType right) => left.Equals(right); diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ProvisioningStateSHC.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ProvisioningStateSHC.cs new file mode 100644 index 000000000000..2bfab0357853 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ProvisioningStateSHC.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Provisioning state of the Session Host Configuration. + public readonly partial struct ProvisioningStateSHC : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningStateSHC(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + + /// Succeeded. + public static ProvisioningStateSHC Succeeded { get; } = new ProvisioningStateSHC(SucceededValue); + /// Failed. + public static ProvisioningStateSHC Failed { get; } = new ProvisioningStateSHC(FailedValue); + /// Canceled. + public static ProvisioningStateSHC Canceled { get; } = new ProvisioningStateSHC(CanceledValue); + /// Provisioning. + public static ProvisioningStateSHC Provisioning { get; } = new ProvisioningStateSHC(ProvisioningValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningStateSHC left, ProvisioningStateSHC right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningStateSHC left, ProvisioningStateSHC right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningStateSHC(string value) => new ProvisioningStateSHC(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningStateSHC other && Equals(other); + /// + public bool Equals(ProvisioningStateSHC other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicUDP.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicUDP.cs new file mode 100644 index 000000000000..539637147747 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/PublicUDP.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + public readonly partial struct PublicUDP : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PublicUDP(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Default. + public static PublicUDP Default { get; } = new PublicUDP(DefaultValue); + /// Enabled. + public static PublicUDP Enabled { get; } = new PublicUDP(EnabledValue); + /// Disabled. + public static PublicUDP Disabled { get; } = new PublicUDP(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(PublicUDP left, PublicUDP right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublicUDP left, PublicUDP right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PublicUDP(string value) => new PublicUDP(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublicUDP other && Equals(other); + /// + public bool Equals(PublicUDP other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenList.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenList.Serialization.cs new file mode 100644 index 000000000000..5b52bd5c1dbf --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenList.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class RegistrationTokenList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegistrationTokenList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RegistrationTokenList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegistrationTokenList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegistrationTokenList(document.RootElement, options); + } + + internal static RegistrationTokenList DeserializeRegistrationTokenList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RegistrationTokenMinimal.DeserializeRegistrationTokenMinimal(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegistrationTokenList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(RegistrationTokenList)} does not support writing '{options.Format}' format."); + } + } + + RegistrationTokenList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRegistrationTokenList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegistrationTokenList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenList.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenList.cs new file mode 100644 index 000000000000..063b3f9a8225 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenList.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// List of RegistrationToken definitions. + internal partial class RegistrationTokenList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RegistrationTokenList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of RegistrationToken definitions. + /// Link to the next page of results. + /// Keeps track of any properties unknown to the library. + internal RegistrationTokenList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of RegistrationToken definitions. + [WirePath("value")] + public IReadOnlyList Value { get; } + /// Link to the next page of results. + [WirePath("nextLink")] + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenMinimal.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenMinimal.Serialization.cs new file mode 100644 index 000000000000..530fb6037b9c --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenMinimal.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class RegistrationTokenMinimal : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegistrationTokenMinimal)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExpireOn)) + { + if (ExpireOn != null) + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpireOn.Value, "O"); + } + else + { + writer.WriteNull("expirationTime"); + } + } + if (Optional.IsDefined(Token)) + { + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RegistrationTokenMinimal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegistrationTokenMinimal)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegistrationTokenMinimal(document.RootElement, options); + } + + internal static RegistrationTokenMinimal DeserializeRegistrationTokenMinimal(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? expirationTime = default; + string token = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expirationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + expirationTime = null; + continue; + } + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("token"u8)) + { + token = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegistrationTokenMinimal(expirationTime, token, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpireOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expirationTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpireOn)) + { + builder.Append(" expirationTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpireOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Token), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" token: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Token)) + { + builder.Append(" token: "); + if (Token.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Token}'''"); + } + else + { + builder.AppendLine($"'{Token}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(RegistrationTokenMinimal)} does not support writing '{options.Format}' format."); + } + } + + RegistrationTokenMinimal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRegistrationTokenMinimal(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegistrationTokenMinimal)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenMinimal.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenMinimal.cs new file mode 100644 index 000000000000..21b2be9ed9d3 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RegistrationTokenMinimal.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Represents a Minimal set of properties for RegistrationToken definition. + public partial class RegistrationTokenMinimal + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RegistrationTokenMinimal() + { + } + + /// Initializes a new instance of . + /// Expiration time of registration token. + /// The registration token base64 encoded string. + /// Keeps track of any properties unknown to the library. + internal RegistrationTokenMinimal(DateTimeOffset? expireOn, string token, IDictionary serializedAdditionalRawData) + { + ExpireOn = expireOn; + Token = token; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Expiration time of registration token. + [WirePath("expirationTime")] + public DateTimeOffset? ExpireOn { get; } + /// The registration token base64 encoded string. + [WirePath("token")] + public string Token { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RelayUDP.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RelayUDP.cs new file mode 100644 index 000000000000..45f797ca2deb --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/RelayUDP.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will attempt this connection type when making connections. This means that this connection is possible, but is not guaranteed, as there are other factors that may prevent this connection type, Disabled: UDP will not attempt this connection type when making connections. + public readonly partial struct RelayUDP : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RelayUDP(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Default. + public static RelayUDP Default { get; } = new RelayUDP(DefaultValue); + /// Enabled. + public static RelayUDP Enabled { get; } = new RelayUDP(EnabledValue); + /// Disabled. + public static RelayUDP Disabled { get; } = new RelayUDP(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(RelayUDP left, RelayUDP right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RelayUDP left, RelayUDP right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RelayUDP(string value) => new RelayUDP(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RelayUDP other && Equals(other); + /// + public bool Equals(RelayUDP other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingHostPoolType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingHostPoolType.cs index 97a53ace5092..9453899c6a27 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingHostPoolType.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingHostPoolType.cs @@ -23,9 +23,12 @@ public ScalingHostPoolType(string value) } private const string PooledValue = "Pooled"; + private const string PersonalValue = "Personal"; /// Users get a new (random) SessionHost every time it connects to the HostPool. public static ScalingHostPoolType Pooled { get; } = new ScalingHostPoolType(PooledValue); + /// Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType = Direct) or upon connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to their assigned SessionHost. + public static ScalingHostPoolType Personal { get; } = new ScalingHostPoolType(PersonalValue); /// Determines if two values are the same. public static bool operator ==(ScalingHostPoolType left, ScalingHostPoolType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPatch.cs index 030ab78c233a..4021e05a30ed 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPatch.cs @@ -59,7 +59,7 @@ public ScalingPlanPatch() /// User friendly name of scaling plan. /// Timezone of the scaling plan. /// Exclusion tag for scaling plan. - /// List of ScalingSchedule definitions. + /// List Pooled ScalingSchedule definitions. /// List of ScalingHostPoolReference definitions. /// Keeps track of any properties unknown to the library. internal ScalingPlanPatch(IDictionary tags, string description, string friendlyName, string timeZone, string exclusionTag, IList schedules, IList hostPoolReferences, IDictionary serializedAdditionalRawData) @@ -89,7 +89,7 @@ internal ScalingPlanPatch(IDictionary tags, string description, /// Exclusion tag for scaling plan. [WirePath("properties.exclusionTag")] public string ExclusionTag { get; set; } - /// List of ScalingSchedule definitions. + /// List Pooled ScalingSchedule definitions. [WirePath("properties.schedules")] public IList Schedules { get; } /// List of ScalingHostPoolReference definitions. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.Serialization.cs index c46ccb1c696f..1e70d9823003 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.Serialization.cs @@ -40,6 +40,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(NamePropertiesName)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(NamePropertiesName); + } if (Optional.IsCollectionDefined(DaysOfWeek)) { writer.WritePropertyName("daysOfWeek"u8); @@ -157,6 +162,7 @@ internal static ScalingPlanPooledSchedulePatch DeserializeScalingPlanPooledSched string name = default; ResourceType type = default; SystemData systemData = default; + string name0 = default; IList daysOfWeek = default; ScalingActionTime rampUpStartTime = default; SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = default; @@ -211,6 +217,11 @@ internal static ScalingPlanPooledSchedulePatch DeserializeScalingPlanPooledSched } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("name"u8)) + { + name0 = property0.Value.GetString(); + continue; + } if (property0.NameEquals("daysOfWeek"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -379,6 +390,7 @@ internal static ScalingPlanPooledSchedulePatch DeserializeScalingPlanPooledSched name, type, systemData, + name0, daysOfWeek ?? new ChangeTrackingList(), rampUpStartTime, rampUpLoadBalancingAlgorithm, @@ -465,6 +477,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append(" properties:"); builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NamePropertiesName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NamePropertiesName)) + { + builder.Append(" name: "); + if (NamePropertiesName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NamePropertiesName}'''"); + } + else + { + builder.AppendLine($"'{NamePropertiesName}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DaysOfWeek), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.cs index 34477736b445..b5af95dc7b36 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingPlanPooledSchedulePatch.cs @@ -58,6 +58,7 @@ public ScalingPlanPooledSchedulePatch() /// The name. /// The resourceType. /// The systemData. + /// Name of the ScalingPlanPooledSchedule. /// Set of days of the week on which this schedule is active. /// Starting time for ramp up period. /// Load balancing algorithm for ramp up period. @@ -76,8 +77,9 @@ public ScalingPlanPooledSchedulePatch() /// Starting time for off-peak period. /// Load balancing algorithm for off-peak period. /// Keeps track of any properties unknown to the library. - internal ScalingPlanPooledSchedulePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ScalingPlanPooledSchedulePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string namePropertiesName, IList daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { + NamePropertiesName = namePropertiesName; DaysOfWeek = daysOfWeek; RampUpStartTime = rampUpStartTime; RampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm; @@ -98,6 +100,9 @@ internal ScalingPlanPooledSchedulePatch(ResourceIdentifier id, string name, Reso _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Name of the ScalingPlanPooledSchedule. + [WirePath("properties.name")] + public string NamePropertiesName { get; } /// Set of days of the week on which this schedule is active. [WirePath("properties.daysOfWeek")] public IList DaysOfWeek { get; } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.Serialization.cs index 4cd736e45417..ced09c68fc6a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.Serialization.cs @@ -47,7 +47,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in DaysOfWeek) { - writer.WriteStringValue(item.ToString()); + writer.WriteStringValue(item.ToSerialString()); } writer.WriteEndArray(); } @@ -169,7 +169,7 @@ internal static ScalingSchedule DeserializeScalingSchedule(JsonElement element, return null; } string name = default; - IList daysOfWeek = default; + IList daysOfWeek = default; ScalingActionTime rampUpStartTime = default; SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = default; int? rampUpMinimumHostsPct = default; @@ -201,10 +201,10 @@ internal static ScalingSchedule DeserializeScalingSchedule(JsonElement element, { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(new ScalingScheduleDaysOfWeekItem(item.GetString())); + array.Add(item.GetString().ToDesktopVirtualizationDayOfWeek()); } daysOfWeek = array; continue; @@ -357,7 +357,7 @@ internal static ScalingSchedule DeserializeScalingSchedule(JsonElement element, serializedAdditionalRawData = rawDataDictionary; return new ScalingSchedule( name, - daysOfWeek ?? new ChangeTrackingList(), + daysOfWeek ?? new ChangeTrackingList(), rampUpStartTime, rampUpLoadBalancingAlgorithm, rampUpMinimumHostsPct, @@ -427,7 +427,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("["); foreach (var item in DaysOfWeek) { - builder.AppendLine($" '{item.ToString()}'"); + builder.AppendLine($" '{item.ToSerialString()}'"); } builder.AppendLine(" ]"); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.cs index 99dd96781f1b..f1f81fed6fd0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingSchedule.cs @@ -48,7 +48,7 @@ public partial class ScalingSchedule /// Initializes a new instance of . public ScalingSchedule() { - DaysOfWeek = new ChangeTrackingList(); + DaysOfWeek = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -71,7 +71,7 @@ public ScalingSchedule() /// Starting time for off-peak period. /// Load balancing algorithm for off-peak period. /// Keeps track of any properties unknown to the library. - internal ScalingSchedule(string name, IList daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm, IDictionary serializedAdditionalRawData) + internal ScalingSchedule(string name, IList daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm, IDictionary serializedAdditionalRawData) { Name = name; DaysOfWeek = daysOfWeek; @@ -99,7 +99,7 @@ internal ScalingSchedule(string name, IList daysO public string Name { get; set; } /// Set of days of the week on which this schedule is active. [WirePath("daysOfWeek")] - public IList DaysOfWeek { get; } + public IList DaysOfWeek { get; } /// Starting time for ramp up period. [WirePath("rampUpStartTime")] public ScalingActionTime RampUpStartTime { get; set; } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingScheduleDaysOfWeekItem.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingScheduleDaysOfWeekItem.cs deleted file mode 100644 index e4af1086d56a..000000000000 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/ScalingScheduleDaysOfWeekItem.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.DesktopVirtualization.Models -{ - /// The ScalingScheduleDaysOfWeekItem. - public readonly partial struct ScalingScheduleDaysOfWeekItem : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ScalingScheduleDaysOfWeekItem(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SundayValue = "Sunday"; - private const string MondayValue = "Monday"; - private const string TuesdayValue = "Tuesday"; - private const string WednesdayValue = "Wednesday"; - private const string ThursdayValue = "Thursday"; - private const string FridayValue = "Friday"; - private const string SaturdayValue = "Saturday"; - - /// Sunday. - public static ScalingScheduleDaysOfWeekItem Sunday { get; } = new ScalingScheduleDaysOfWeekItem(SundayValue); - /// Monday. - public static ScalingScheduleDaysOfWeekItem Monday { get; } = new ScalingScheduleDaysOfWeekItem(MondayValue); - /// Tuesday. - public static ScalingScheduleDaysOfWeekItem Tuesday { get; } = new ScalingScheduleDaysOfWeekItem(TuesdayValue); - /// Wednesday. - public static ScalingScheduleDaysOfWeekItem Wednesday { get; } = new ScalingScheduleDaysOfWeekItem(WednesdayValue); - /// Thursday. - public static ScalingScheduleDaysOfWeekItem Thursday { get; } = new ScalingScheduleDaysOfWeekItem(ThursdayValue); - /// Friday. - public static ScalingScheduleDaysOfWeekItem Friday { get; } = new ScalingScheduleDaysOfWeekItem(FridayValue); - /// Saturday. - public static ScalingScheduleDaysOfWeekItem Saturday { get; } = new ScalingScheduleDaysOfWeekItem(SaturdayValue); - /// Determines if two values are the same. - public static bool operator ==(ScalingScheduleDaysOfWeekItem left, ScalingScheduleDaysOfWeekItem right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ScalingScheduleDaysOfWeekItem left, ScalingScheduleDaysOfWeekItem right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ScalingScheduleDaysOfWeekItem(string value) => new ScalingScheduleDaysOfWeekItem(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ScalingScheduleDaysOfWeekItem other && Equals(other); - /// - public bool Equals(ScalingScheduleDaysOfWeekItem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoPatchProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoPatchProperties.Serialization.cs new file mode 100644 index 000000000000..d61525cafeb4 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoPatchProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class SecurityInfoPatchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityInfoPatchProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VirtualMachineSecurityType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(VirtualMachineSecurityType.Value.ToString()); + } + if (Optional.IsDefined(SecureBootEnabled)) + { + writer.WritePropertyName("secureBootEnabled"u8); + writer.WriteBooleanValue(SecureBootEnabled.Value); + } + if (Optional.IsDefined(VTpmEnabled)) + { + writer.WritePropertyName("vTpmEnabled"u8); + writer.WriteBooleanValue(VTpmEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecurityInfoPatchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityInfoPatchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityInfoPatchProperties(document.RootElement, options); + } + + internal static SecurityInfoPatchProperties DeserializeSecurityInfoPatchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualMachineSecurityType? type = default; + bool? secureBootEnabled = default; + bool? vTpmEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new VirtualMachineSecurityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("secureBootEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secureBootEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("vTpmEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vTpmEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityInfoPatchProperties(type, secureBootEnabled, vTpmEnabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecurityInfoPatchProperties)} does not support writing '{options.Format}' format."); + } + } + + SecurityInfoPatchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecurityInfoPatchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityInfoPatchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoPatchProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoPatchProperties.cs new file mode 100644 index 000000000000..606607c79873 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoPatchProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Security information. + public partial class SecurityInfoPatchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SecurityInfoPatchProperties() + { + } + + /// Initializes a new instance of . + /// The security type used by virtual machine in hostpool session host. + /// Whether to use secureBoot on the virtual machine. + /// Whether to use vTPM on the virtual machine. + /// Keeps track of any properties unknown to the library. + internal SecurityInfoPatchProperties(VirtualMachineSecurityType? virtualMachineSecurityType, bool? secureBootEnabled, bool? vTpmEnabled, IDictionary serializedAdditionalRawData) + { + VirtualMachineSecurityType = virtualMachineSecurityType; + SecureBootEnabled = secureBootEnabled; + VTpmEnabled = vTpmEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The security type used by virtual machine in hostpool session host. + [WirePath("type")] + public VirtualMachineSecurityType? VirtualMachineSecurityType { get; set; } + /// Whether to use secureBoot on the virtual machine. + [WirePath("secureBootEnabled")] + public bool? SecureBootEnabled { get; set; } + /// Whether to use vTPM on the virtual machine. + [WirePath("vTpmEnabled")] + public bool? VTpmEnabled { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoProperties.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoProperties.Serialization.cs new file mode 100644 index 000000000000..292f45d0daf5 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoProperties.Serialization.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class SecurityInfoProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityInfoProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VirtualMachineSecurityType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(VirtualMachineSecurityType.Value.ToString()); + } + if (Optional.IsDefined(SecureBootEnabled)) + { + writer.WritePropertyName("secureBootEnabled"u8); + writer.WriteBooleanValue(SecureBootEnabled.Value); + } + if (Optional.IsDefined(VTpmEnabled)) + { + writer.WritePropertyName("vTpmEnabled"u8); + writer.WriteBooleanValue(VTpmEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SecurityInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityInfoProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityInfoProperties(document.RootElement, options); + } + + internal static SecurityInfoProperties DeserializeSecurityInfoProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualMachineSecurityType? type = default; + bool? secureBootEnabled = default; + bool? vTpmEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new VirtualMachineSecurityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("secureBootEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secureBootEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("vTpmEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vTpmEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityInfoProperties(type, secureBootEnabled, vTpmEnabled, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VirtualMachineSecurityType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VirtualMachineSecurityType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{VirtualMachineSecurityType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecureBootEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secureBootEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecureBootEnabled)) + { + builder.Append(" secureBootEnabled: "); + var boolValue = SecureBootEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VTpmEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vTpmEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VTpmEnabled)) + { + builder.Append(" vTpmEnabled: "); + var boolValue = VTpmEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SecurityInfoProperties)} does not support writing '{options.Format}' format."); + } + } + + SecurityInfoProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecurityInfoProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityInfoProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoProperties.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoProperties.cs new file mode 100644 index 000000000000..27ff088ee265 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SecurityInfoProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Security information. + public partial class SecurityInfoProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SecurityInfoProperties() + { + } + + /// Initializes a new instance of . + /// The security type used by virtual machine in hostpool session host. Default is Standard. + /// Whether to use secureBoot on the virtual machine. + /// Whether to use vTPM on the virtual machine. + /// Keeps track of any properties unknown to the library. + internal SecurityInfoProperties(VirtualMachineSecurityType? virtualMachineSecurityType, bool? secureBootEnabled, bool? vTpmEnabled, IDictionary serializedAdditionalRawData) + { + VirtualMachineSecurityType = virtualMachineSecurityType; + SecureBootEnabled = secureBootEnabled; + VTpmEnabled = vTpmEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The security type used by virtual machine in hostpool session host. Default is Standard. + [WirePath("type")] + public VirtualMachineSecurityType? VirtualMachineSecurityType { get; set; } + /// Whether to use secureBoot on the virtual machine. + [WirePath("secureBootEnabled")] + public bool? SecureBootEnabled { get; set; } + /// Whether to use vTPM on the virtual machine. + [WirePath("vTpmEnabled")] + public bool? VTpmEnabled { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationList.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationList.Serialization.cs new file mode 100644 index 000000000000..fee26bf451f0 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationList.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class SessionHostConfigurationList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostConfigurationList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionHostConfigurationList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostConfigurationList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostConfigurationList(document.RootElement, options); + } + + internal static SessionHostConfigurationList DeserializeSessionHostConfigurationList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SessionHostConfigurationData.DeserializeSessionHostConfigurationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostConfigurationList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionHostConfigurationList)} does not support writing '{options.Format}' format."); + } + } + + SessionHostConfigurationList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostConfigurationList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostConfigurationList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationList.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationList.cs new file mode 100644 index 000000000000..7f04dacad6cd --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationList.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// List of SessionHostConfiguration definitions. + internal partial class SessionHostConfigurationList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SessionHostConfigurationList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of SessionHostConfiguration definitions. + /// Link to the next page of results. + /// Keeps track of any properties unknown to the library. + internal SessionHostConfigurationList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of SessionHostConfiguration definitions. + public IReadOnlyList Value { get; } + /// Link to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationPatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationPatch.Serialization.cs new file mode 100644 index 000000000000..f46c9567d963 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationPatch.Serialization.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class SessionHostConfigurationPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostConfigurationPatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(FriendlyName)) + { + writer.WritePropertyName("friendlyName"u8); + writer.WriteStringValue(FriendlyName); + } + if (Optional.IsCollectionDefined(VmTags)) + { + writer.WritePropertyName("vmTags"u8); + writer.WriteStartObject(); + foreach (var item in VmTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(VmLocation)) + { + writer.WritePropertyName("vmLocation"u8); + writer.WriteStringValue(VmLocation); + } + if (Optional.IsDefined(VmResourceGroup)) + { + writer.WritePropertyName("vmResourceGroup"u8); + writer.WriteStringValue(VmResourceGroup); + } + if (Optional.IsDefined(VmNamePrefix)) + { + writer.WritePropertyName("vmNamePrefix"u8); + writer.WriteStringValue(VmNamePrefix); + } + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + writer.WritePropertyName("availabilityZones"u8); + writer.WriteStartArray(); + foreach (var item in AvailabilityZones) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NetworkInfo)) + { + writer.WritePropertyName("networkInfo"u8); + writer.WriteObjectValue(NetworkInfo, options); + } + if (Optional.IsDefined(VmSizeId)) + { + writer.WritePropertyName("vmSizeId"u8); + writer.WriteStringValue(VmSizeId); + } + if (Optional.IsDefined(DiskInfo)) + { + writer.WritePropertyName("diskInfo"u8); + writer.WriteObjectValue(DiskInfo, options); + } + if (Optional.IsDefined(CustomConfigurationScriptUri)) + { + writer.WritePropertyName("customConfigurationScriptUrl"u8); + writer.WriteStringValue(CustomConfigurationScriptUri.AbsoluteUri); + } + if (Optional.IsDefined(ImageInfo)) + { + writer.WritePropertyName("imageInfo"u8); + writer.WriteObjectValue(ImageInfo, options); + } + if (Optional.IsDefined(DomainInfo)) + { + writer.WritePropertyName("domainInfo"u8); + writer.WriteObjectValue(DomainInfo, options); + } + if (Optional.IsDefined(SecurityInfo)) + { + writer.WritePropertyName("securityInfo"u8); + writer.WriteObjectValue(SecurityInfo, options); + } + if (Optional.IsDefined(VmAdminCredentials)) + { + writer.WritePropertyName("vmAdminCredentials"u8); + writer.WriteObjectValue(VmAdminCredentials, options); + } + if (Optional.IsDefined(BootDiagnosticsInfo)) + { + writer.WritePropertyName("bootDiagnosticsInfo"u8); + writer.WriteObjectValue(BootDiagnosticsInfo, options); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionHostConfigurationPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostConfigurationPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostConfigurationPatch(document.RootElement, options); + } + + internal static SessionHostConfigurationPatch DeserializeSessionHostConfigurationPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string friendlyName = default; + IDictionary vmTags = default; + string vmLocation = default; + string vmResourceGroup = default; + string vmNamePrefix = default; + IList availabilityZones = default; + NetworkInfoPatchProperties networkInfo = default; + string vmSizeId = default; + DiskInfoPatchProperties diskInfo = default; + Uri customConfigurationScriptUrl = default; + ImageInfoPatchProperties imageInfo = default; + DomainInfoPatchProperties domainInfo = default; + SecurityInfoPatchProperties securityInfo = default; + KeyVaultCredentialsPatchProperties vmAdminCredentials = default; + BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("friendlyName"u8)) + { + friendlyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmTags"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + vmTags = dictionary; + continue; + } + if (property0.NameEquals("vmLocation"u8)) + { + vmLocation = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmResourceGroup"u8)) + { + vmResourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmNamePrefix"u8)) + { + vmNamePrefix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("availabilityZones"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + availabilityZones = array; + continue; + } + if (property0.NameEquals("networkInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkInfo = NetworkInfoPatchProperties.DeserializeNetworkInfoPatchProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("vmSizeId"u8)) + { + vmSizeId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("diskInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskInfo = DiskInfoPatchProperties.DeserializeDiskInfoPatchProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("customConfigurationScriptUrl"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customConfigurationScriptUrl = new Uri(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("imageInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageInfo = ImageInfoPatchProperties.DeserializeImageInfoPatchProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("domainInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainInfo = DomainInfoPatchProperties.DeserializeDomainInfoPatchProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("securityInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityInfo = SecurityInfoPatchProperties.DeserializeSecurityInfoPatchProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("vmAdminCredentials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmAdminCredentials = KeyVaultCredentialsPatchProperties.DeserializeKeyVaultCredentialsPatchProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("bootDiagnosticsInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootDiagnosticsInfo = BootDiagnosticsInfoPatchProperties.DeserializeBootDiagnosticsInfoPatchProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostConfigurationPatch( + friendlyName, + vmTags ?? new ChangeTrackingDictionary(), + vmLocation, + vmResourceGroup, + vmNamePrefix, + availabilityZones ?? new ChangeTrackingList(), + networkInfo, + vmSizeId, + diskInfo, + customConfigurationScriptUrl, + imageInfo, + domainInfo, + securityInfo, + vmAdminCredentials, + bootDiagnosticsInfo, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SessionHostConfigurationPatch)} does not support writing '{options.Format}' format."); + } + } + + SessionHostConfigurationPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostConfigurationPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostConfigurationPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationPatch.cs new file mode 100644 index 000000000000..8690c30f7bfa --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostConfigurationPatch.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Represents a SessionHostConfigurationPatch definition. + public partial class SessionHostConfigurationPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SessionHostConfigurationPatch() + { + VmTags = new ChangeTrackingDictionary(); + AvailabilityZones = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Friendly name to describe this version of the SessionHostConfiguration. + /// Hashtable that lists key/value pair tags to apply to the VMs. + /// The Location for the session host to be created in. + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + /// The prefix that should be associated with session host names. + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Security information. + /// Local Admin credentials for session hosts. + /// Boot Diagnostics information. + /// Keeps track of any properties unknown to the library. + internal SessionHostConfigurationPatch(string friendlyName, IDictionary vmTags, string vmLocation, string vmResourceGroup, string vmNamePrefix, IList availabilityZones, NetworkInfoPatchProperties networkInfo, string vmSizeId, DiskInfoPatchProperties diskInfo, Uri customConfigurationScriptUri, ImageInfoPatchProperties imageInfo, DomainInfoPatchProperties domainInfo, SecurityInfoPatchProperties securityInfo, KeyVaultCredentialsPatchProperties vmAdminCredentials, BootDiagnosticsInfoPatchProperties bootDiagnosticsInfo, IDictionary serializedAdditionalRawData) + { + FriendlyName = friendlyName; + VmTags = vmTags; + VmLocation = vmLocation; + VmResourceGroup = vmResourceGroup; + VmNamePrefix = vmNamePrefix; + AvailabilityZones = availabilityZones; + NetworkInfo = networkInfo; + VmSizeId = vmSizeId; + DiskInfo = diskInfo; + CustomConfigurationScriptUri = customConfigurationScriptUri; + ImageInfo = imageInfo; + DomainInfo = domainInfo; + SecurityInfo = securityInfo; + VmAdminCredentials = vmAdminCredentials; + BootDiagnosticsInfo = bootDiagnosticsInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Friendly name to describe this version of the SessionHostConfiguration. + [WirePath("properties.friendlyName")] + public string FriendlyName { get; set; } + /// Hashtable that lists key/value pair tags to apply to the VMs. + [WirePath("properties.vmTags")] + public IDictionary VmTags { get; } + /// The Location for the session host to be created in. + [WirePath("properties.vmLocation")] + public string VmLocation { get; set; } + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + [WirePath("properties.vmResourceGroup")] + public string VmResourceGroup { get; set; } + /// The prefix that should be associated with session host names. + [WirePath("properties.vmNamePrefix")] + public string VmNamePrefix { get; set; } + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + [WirePath("properties.availabilityZones")] + public IList AvailabilityZones { get; } + /// Network information. + [WirePath("properties.networkInfo")] + public NetworkInfoPatchProperties NetworkInfo { get; set; } + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + [WirePath("properties.vmSizeId")] + public string VmSizeId { get; set; } + /// Disk information. + internal DiskInfoPatchProperties DiskInfo { get; set; } + /// The disk type used by virtual machine in hostpool session host. + [WirePath("properties.diskInfo.type")] + public VirtualMachineDiskType? VirtualMachineDiskType + { + get => DiskInfo is null ? default : DiskInfo.VirtualMachineDiskType; + set + { + if (DiskInfo is null) + DiskInfo = new DiskInfoPatchProperties(); + DiskInfo.VirtualMachineDiskType = value; + } + } + + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + [WirePath("properties.customConfigurationScriptUrl")] + public Uri CustomConfigurationScriptUri { get; set; } + /// Image configurations of HostPool. + [WirePath("properties.imageInfo")] + public ImageInfoPatchProperties ImageInfo { get; set; } + /// Domain configurations of session hosts. + internal DomainInfoPatchProperties DomainInfo { get; set; } + /// Credentials needed to create the virtual machine. + [WirePath("properties.domainInfo.activeDirectoryInfo.domainCredentials")] + public KeyVaultCredentialsPatchProperties ActiveDirectoryInfoDomainCredentials + { + get => DomainInfo is null ? default : DomainInfo.ActiveDirectoryInfoDomainCredentials; + set + { + if (DomainInfo is null) + DomainInfo = new DomainInfoPatchProperties(); + DomainInfo.ActiveDirectoryInfoDomainCredentials = value; + } + } + + /// Security information. + [WirePath("properties.securityInfo")] + public SecurityInfoPatchProperties SecurityInfo { get; set; } + /// Local Admin credentials for session hosts. + [WirePath("properties.vmAdminCredentials")] + public KeyVaultCredentialsPatchProperties VmAdminCredentials { get; set; } + /// Boot Diagnostics information. + [WirePath("properties.bootDiagnosticsInfo")] + public BootDiagnosticsInfoPatchProperties BootDiagnosticsInfo { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementList.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementList.Serialization.cs new file mode 100644 index 000000000000..f0f206d05906 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementList.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + internal partial class SessionHostManagementList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementList)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionHostManagementList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostManagementList(document.RootElement, options); + } + + internal static SessionHostManagementList DeserializeSessionHostManagementList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SessionHostManagementData.DeserializeSessionHostManagementData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostManagementList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" nextLink: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NextLink)) + { + builder.Append(" nextLink: "); + if (NextLink.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NextLink}'''"); + } + else + { + builder.AppendLine($"'{NextLink}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionHostManagementList)} does not support writing '{options.Format}' format."); + } + } + + SessionHostManagementList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostManagementList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostManagementList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementList.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementList.cs new file mode 100644 index 000000000000..6543f2ae37a0 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementList.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// List of SessionHostManagement definitions. + internal partial class SessionHostManagementList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SessionHostManagementList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of SessionHostManagement definitions. + /// Link to the next page of results. + /// Keeps track of any properties unknown to the library. + internal SessionHostManagementList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of SessionHostManagement definitions. + public IReadOnlyList Value { get; } + /// Link to the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementOperationProgress.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementOperationProgress.Serialization.cs new file mode 100644 index 000000000000..a237a6955d5b --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementOperationProgress.Serialization.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class SessionHostManagementOperationProgress : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementOperationProgress)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExecutionStartOn)) + { + writer.WritePropertyName("executionStartTime"u8); + writer.WriteStringValue(ExecutionStartOn.Value, "O"); + } + if (Optional.IsDefined(TotalSessionHosts)) + { + writer.WritePropertyName("totalSessionHosts"u8); + writer.WriteNumberValue(TotalSessionHosts.Value); + } + if (Optional.IsDefined(SessionHostsInProgress)) + { + writer.WritePropertyName("sessionHostsInProgress"u8); + writer.WriteNumberValue(SessionHostsInProgress.Value); + } + if (Optional.IsDefined(SessionHostsCompleted)) + { + writer.WritePropertyName("sessionHostsCompleted"u8); + writer.WriteNumberValue(SessionHostsCompleted.Value); + } + if (Optional.IsDefined(SessionHostsRollbackFailed)) + { + writer.WritePropertyName("sessionHostsRollbackFailed"u8); + writer.WriteNumberValue(SessionHostsRollbackFailed.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionHostManagementOperationProgress IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementOperationProgress)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostManagementOperationProgress(document.RootElement, options); + } + + internal static SessionHostManagementOperationProgress DeserializeSessionHostManagementOperationProgress(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? executionStartTime = default; + int? totalSessionHosts = default; + int? sessionHostsInProgress = default; + int? sessionHostsCompleted = default; + int? sessionHostsRollbackFailed = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("executionStartTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionStartTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("totalSessionHosts"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalSessionHosts = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sessionHostsInProgress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sessionHostsInProgress = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sessionHostsCompleted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sessionHostsCompleted = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sessionHostsRollbackFailed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sessionHostsRollbackFailed = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostManagementOperationProgress( + executionStartTime, + totalSessionHosts, + sessionHostsInProgress, + sessionHostsCompleted, + sessionHostsRollbackFailed, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExecutionStartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" executionStartTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExecutionStartOn)) + { + builder.Append(" executionStartTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExecutionStartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TotalSessionHosts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" totalSessionHosts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TotalSessionHosts)) + { + builder.Append(" totalSessionHosts: "); + builder.AppendLine($"{TotalSessionHosts.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SessionHostsInProgress), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sessionHostsInProgress: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SessionHostsInProgress)) + { + builder.Append(" sessionHostsInProgress: "); + builder.AppendLine($"{SessionHostsInProgress.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SessionHostsCompleted), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sessionHostsCompleted: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SessionHostsCompleted)) + { + builder.Append(" sessionHostsCompleted: "); + builder.AppendLine($"{SessionHostsCompleted.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SessionHostsRollbackFailed), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sessionHostsRollbackFailed: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SessionHostsRollbackFailed)) + { + builder.Append(" sessionHostsRollbackFailed: "); + builder.AppendLine($"{SessionHostsRollbackFailed.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionHostManagementOperationProgress)} does not support writing '{options.Format}' format."); + } + } + + SessionHostManagementOperationProgress IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostManagementOperationProgress(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostManagementOperationProgress)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementOperationProgress.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementOperationProgress.cs new file mode 100644 index 000000000000..4742427d59ff --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementOperationProgress.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// SessionHostManagement Operation Progress information. + public partial class SessionHostManagementOperationProgress + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal SessionHostManagementOperationProgress() + { + } + + /// Initializes a new instance of . + /// Time that the sessionHostManagement operation was created. + /// The number of sessionHosts to be started in the sessionHostManagement operation. + /// The number of sessionHosts in progress in the sessionHostManagement operation. + /// The number of sessionHosts completed in the sessionHostManagement operation. + /// The number of sessionHosts rollback failed in the sessionHostManagement operation. + /// Keeps track of any properties unknown to the library. + internal SessionHostManagementOperationProgress(DateTimeOffset? executionStartOn, int? totalSessionHosts, int? sessionHostsInProgress, int? sessionHostsCompleted, int? sessionHostsRollbackFailed, IDictionary serializedAdditionalRawData) + { + ExecutionStartOn = executionStartOn; + TotalSessionHosts = totalSessionHosts; + SessionHostsInProgress = sessionHostsInProgress; + SessionHostsCompleted = sessionHostsCompleted; + SessionHostsRollbackFailed = sessionHostsRollbackFailed; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Time that the sessionHostManagement operation was created. + [WirePath("executionStartTime")] + public DateTimeOffset? ExecutionStartOn { get; } + /// The number of sessionHosts to be started in the sessionHostManagement operation. + [WirePath("totalSessionHosts")] + public int? TotalSessionHosts { get; } + /// The number of sessionHosts in progress in the sessionHostManagement operation. + [WirePath("sessionHostsInProgress")] + public int? SessionHostsInProgress { get; } + /// The number of sessionHosts completed in the sessionHostManagement operation. + [WirePath("sessionHostsCompleted")] + public int? SessionHostsCompleted { get; } + /// The number of sessionHosts rollback failed in the sessionHostManagement operation. + [WirePath("sessionHostsRollbackFailed")] + public int? SessionHostsRollbackFailed { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementPatch.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementPatch.Serialization.cs new file mode 100644 index 000000000000..4374a8164b44 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementPatch.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class SessionHostManagementPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementPatch)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ScheduledDateTimeZone)) + { + writer.WritePropertyName("scheduledDateTimeZone"u8); + writer.WriteStringValue(ScheduledDateTimeZone); + } + if (Optional.IsDefined(Update)) + { + writer.WritePropertyName("update"u8); + writer.WriteObjectValue(Update, options); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionHostManagementPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostManagementPatch(document.RootElement, options); + } + + internal static SessionHostManagementPatch DeserializeSessionHostManagementPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string scheduledDateTimeZone = default; + HostPoolUpdateConfigurationPatchProperties update = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("scheduledDateTimeZone"u8)) + { + scheduledDateTimeZone = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("update"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + update = HostPoolUpdateConfigurationPatchProperties.DeserializeHostPoolUpdateConfigurationPatchProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostManagementPatch(scheduledDateTimeZone, update, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SessionHostManagementPatch)} does not support writing '{options.Format}' format."); + } + } + + SessionHostManagementPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostManagementPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostManagementPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementPatch.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementPatch.cs new file mode 100644 index 000000000000..d01a9bd04ea8 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementPatch.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Represents a SessionHostManagementPatch definition. + public partial class SessionHostManagementPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SessionHostManagementPatch() + { + } + + /// Initializes a new instance of . + /// Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. + /// Parameters for a hostpool update. + /// Keeps track of any properties unknown to the library. + internal SessionHostManagementPatch(string scheduledDateTimeZone, HostPoolUpdateConfigurationPatchProperties update, IDictionary serializedAdditionalRawData) + { + ScheduledDateTimeZone = scheduledDateTimeZone; + Update = update; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. + [WirePath("properties.scheduledDateTimeZone")] + public string ScheduledDateTimeZone { get; set; } + /// Parameters for a hostpool update. + [WirePath("properties.update")] + public HostPoolUpdateConfigurationPatchProperties Update { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementUpdateStatus.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementUpdateStatus.Serialization.cs new file mode 100644 index 000000000000..a595962e1584 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementUpdateStatus.Serialization.cs @@ -0,0 +1,512 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class SessionHostManagementUpdateStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementUpdateStatus)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + if (Optional.IsDefined(PercentComplete)) + { + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete.Value); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (Optional.IsDefined(Progress)) + { + writer.WritePropertyName("progress"u8); + writer.WriteObjectValue(Progress, options); + } + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledDateTime"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } + if (Optional.IsDefined(SessionHostManagement)) + { + writer.WritePropertyName("sessionHostManagement"u8); + writer.WriteObjectValue(SessionHostManagement, options); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SessionHostManagementUpdateStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementUpdateStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostManagementUpdateStatus(document.RootElement, options); + } + + internal static SessionHostManagementUpdateStatus DeserializeSessionHostManagementUpdateStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + string status = default; + float? percentComplete = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + ResponseError error = default; + string correlationId = default; + SessionHostManagementOperationProgress progress = default; + DateTimeOffset? scheduledDateTime = default; + SessionHostManagementData sessionHostManagement = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentComplete = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("correlationId"u8)) + { + correlationId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("progress"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + progress = SessionHostManagementOperationProgress.DeserializeSessionHostManagementOperationProgress(property0.Value, options); + continue; + } + if (property0.NameEquals("scheduledDateTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledDateTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("sessionHostManagement"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sessionHostManagement = SessionHostManagementData.DeserializeSessionHostManagementData(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostManagementUpdateStatus( + id, + name, + status, + percentComplete, + startTime, + endTime, + error, + correlationId, + progress, + scheduledDateTime, + sessionHostManagement, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PercentComplete), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" percentComplete: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PercentComplete)) + { + builder.Append(" percentComplete: "); + builder.AppendLine($"'{PercentComplete.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartOn)) + { + builder.Append(" startTime: "); + var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" endTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EndOn)) + { + builder.Append(" endTime: "); + var formattedDateTimeString = TypeFormatters.ToString(EndOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 2, false, " error: "); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CorrelationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" correlationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CorrelationId)) + { + builder.Append(" correlationId: "); + if (CorrelationId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CorrelationId}'''"); + } + else + { + builder.AppendLine($"'{CorrelationId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Progress), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" progress: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Progress)) + { + builder.Append(" progress: "); + BicepSerializationHelpers.AppendChildObject(builder, Progress, options, 4, false, " progress: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduledOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scheduledDateTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ScheduledOn)) + { + builder.Append(" scheduledDateTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ScheduledOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SessionHostManagement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sessionHostManagement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SessionHostManagement)) + { + builder.Append(" sessionHostManagement: "); + BicepSerializationHelpers.AppendChildObject(builder, SessionHostManagement, options, 4, false, " sessionHostManagement: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionHostManagementUpdateStatus)} does not support writing '{options.Format}' format."); + } + } + + SessionHostManagementUpdateStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostManagementUpdateStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostManagementUpdateStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementUpdateStatus.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementUpdateStatus.cs new file mode 100644 index 000000000000..c391734a9d77 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/SessionHostManagementUpdateStatus.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The current status of the session host update async operation. + public partial class SessionHostManagementUpdateStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled. + /// is null. + internal SessionHostManagementUpdateStatus(string status) + { + Argument.AssertNotNull(status, nameof(status)); + + Status = status; + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// If present, details of the operation error. + /// The Log Analytics. + /// Progress information on the sessionHostManagement operation. + /// The timestamp that the update is scheduled for. + /// SessionHostManagement properties used for the operation. + /// Keeps track of any properties unknown to the library. + internal SessionHostManagementUpdateStatus(string id, string name, string status, float? percentComplete, DateTimeOffset? startOn, DateTimeOffset? endOn, ResponseError error, string correlationId, SessionHostManagementOperationProgress progress, DateTimeOffset? scheduledOn, SessionHostManagementData sessionHostManagement, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + Status = status; + PercentComplete = percentComplete; + StartOn = startOn; + EndOn = endOn; + Error = error; + CorrelationId = correlationId; + Progress = progress; + ScheduledOn = scheduledOn; + SessionHostManagement = sessionHostManagement; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionHostManagementUpdateStatus() + { + } + + /// Fully qualified ID for the async operation. + [WirePath("id")] + public string Id { get; } + /// Name of the async operation. + [WirePath("name")] + public string Name { get; } + /// Operation status. Current defined values are < Error | Scheduled | UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > | Succeeded | Failed | Canceled. + [WirePath("status")] + public string Status { get; } + /// Percent of the operation that is complete. + [WirePath("percentComplete")] + public float? PercentComplete { get; } + /// The start time of the operation. + [WirePath("startTime")] + public DateTimeOffset? StartOn { get; } + /// The end time of the operation. + [WirePath("endTime")] + public DateTimeOffset? EndOn { get; } + /// If present, details of the operation error. + [WirePath("error")] + public ResponseError Error { get; } + /// The Log Analytics. + [WirePath("properties.correlationId")] + public string CorrelationId { get; } + /// Progress information on the sessionHostManagement operation. + [WirePath("properties.progress")] + public SessionHostManagementOperationProgress Progress { get; } + /// The timestamp that the update is scheduled for. + [WirePath("properties.scheduledDateTime")] + public DateTimeOffset? ScheduledOn { get; } + /// SessionHostManagement properties used for the operation. + [WirePath("properties.sessionHostManagement")] + public SessionHostManagementData SessionHostManagement { get; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/Type.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/Type.cs new file mode 100644 index 000000000000..31791de716dd --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/Type.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The type of image session hosts use in the hostpool. + public readonly partial struct Type : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Type(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MarketplaceValue = "Marketplace"; + private const string CustomValue = "Custom"; + + /// Using default marketplace images offered by Azure Marketplace. + public static Type Marketplace { get; } = new Type(MarketplaceValue); + /// Using a custom image. + public static Type Custom { get; } = new Type(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(Type left, Type right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Type left, Type right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Type(string value) => new Type(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Type other && Equals(other); + /// + public bool Equals(Type other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/UpdateSessionHostsRequestBody.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/UpdateSessionHostsRequestBody.Serialization.cs new file mode 100644 index 000000000000..8723b41d5fe6 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/UpdateSessionHostsRequestBody.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + public partial class UpdateSessionHostsRequestBody : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateSessionHostsRequestBody)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ScheduledOn)) + { + writer.WritePropertyName("scheduledDateTime"u8); + writer.WriteStringValue(ScheduledOn.Value, "O"); + } + if (Optional.IsDefined(ScheduledDateTimeZone)) + { + writer.WritePropertyName("scheduledDateTimeZone"u8); + writer.WriteStringValue(ScheduledDateTimeZone); + } + if (Optional.IsDefined(Update)) + { + writer.WritePropertyName("update"u8); + writer.WriteObjectValue(Update, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateSessionHostsRequestBody IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateSessionHostsRequestBody)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateSessionHostsRequestBody(document.RootElement, options); + } + + internal static UpdateSessionHostsRequestBody DeserializeUpdateSessionHostsRequestBody(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? scheduledDateTime = default; + string scheduledDateTimeZone = default; + HostPoolUpdateConfigurationPatchProperties update = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scheduledDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("scheduledDateTimeZone"u8)) + { + scheduledDateTimeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("update"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + update = HostPoolUpdateConfigurationPatchProperties.DeserializeHostPoolUpdateConfigurationPatchProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateSessionHostsRequestBody(scheduledDateTime, scheduledDateTimeZone, update, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateSessionHostsRequestBody)} does not support writing '{options.Format}' format."); + } + } + + UpdateSessionHostsRequestBody IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUpdateSessionHostsRequestBody(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateSessionHostsRequestBody)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/UpdateSessionHostsRequestBody.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/UpdateSessionHostsRequestBody.cs new file mode 100644 index 000000000000..97f4e6b9ddb9 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/UpdateSessionHostsRequestBody.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// Object containing the definition for properties to be used for a sessionHostUpdate operation. + public partial class UpdateSessionHostsRequestBody + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public UpdateSessionHostsRequestBody() + { + } + + /// Initializes a new instance of . + /// The timestamp that the update validation is scheduled for. If none is provided, the update will be executed immediately. + /// The timeZone as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + /// settings for management information for the hostpool update operation. If none is provided the update will use the settings saved in the sessionHostManagement object. + /// Keeps track of any properties unknown to the library. + internal UpdateSessionHostsRequestBody(DateTimeOffset? scheduledOn, string scheduledDateTimeZone, HostPoolUpdateConfigurationPatchProperties update, IDictionary serializedAdditionalRawData) + { + ScheduledOn = scheduledOn; + ScheduledDateTimeZone = scheduledDateTimeZone; + Update = update; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The timestamp that the update validation is scheduled for. If none is provided, the update will be executed immediately. + [WirePath("scheduledDateTime")] + public DateTimeOffset? ScheduledOn { get; set; } + /// The timeZone as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. + [WirePath("scheduledDateTimeZone")] + public string ScheduledDateTimeZone { get; set; } + /// settings for management information for the hostpool update operation. If none is provided the update will use the settings saved in the sessionHostManagement object. + [WirePath("update")] + public HostPoolUpdateConfigurationPatchProperties Update { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualMachineDiskType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualMachineDiskType.cs new file mode 100644 index 000000000000..93bf90551bb7 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualMachineDiskType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The disk type used by virtual machine in hostpool session host. + public readonly partial struct VirtualMachineDiskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VirtualMachineDiskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardLRSValue = "Standard_LRS"; + private const string PremiumLRSValue = "Premium_LRS"; + private const string StandardSSDLRSValue = "StandardSSD_LRS"; + + /// Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. + public static VirtualMachineDiskType StandardLRS { get; } = new VirtualMachineDiskType(StandardLRSValue); + /// Premium SSD locally redundant storage. Best for production and performance sensitive workloads. + public static VirtualMachineDiskType PremiumLRS { get; } = new VirtualMachineDiskType(PremiumLRSValue); + /// Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev/test. + public static VirtualMachineDiskType StandardSSDLRS { get; } = new VirtualMachineDiskType(StandardSSDLRSValue); + /// Determines if two values are the same. + public static bool operator ==(VirtualMachineDiskType left, VirtualMachineDiskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VirtualMachineDiskType left, VirtualMachineDiskType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VirtualMachineDiskType(string value) => new VirtualMachineDiskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VirtualMachineDiskType other && Equals(other); + /// + public bool Equals(VirtualMachineDiskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualMachineSecurityType.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualMachineSecurityType.cs new file mode 100644 index 000000000000..780a7cda4e3e --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/Models/VirtualMachineSecurityType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.DesktopVirtualization.Models +{ + /// The security type used by virtual machine in hostpool session host. Default is Standard. + public readonly partial struct VirtualMachineSecurityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VirtualMachineSecurityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardValue = "Standard"; + private const string TrustedLaunchValue = "TrustedLaunch"; + private const string ConfidentialVmValue = "ConfidentialVM"; + + /// Standard security protocol. No additional parameters. + public static VirtualMachineSecurityType Standard { get; } = new VirtualMachineSecurityType(StandardValue); + /// TrustedLaunch allows for secure boot adn vTPM. + public static VirtualMachineSecurityType TrustedLaunch { get; } = new VirtualMachineSecurityType(TrustedLaunchValue); + /// Confidential Virtual Machine security protocol. + public static VirtualMachineSecurityType ConfidentialVm { get; } = new VirtualMachineSecurityType(ConfidentialVmValue); + /// Determines if two values are the same. + public static bool operator ==(VirtualMachineSecurityType left, VirtualMachineSecurityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VirtualMachineSecurityType left, VirtualMachineSecurityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VirtualMachineSecurityType(string value) => new VirtualMachineSecurityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VirtualMachineSecurityType other && Equals(other); + /// + public bool Equals(VirtualMachineSecurityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageCollection.cs index 4aa621f896fd..62e763b1f911 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string msixPac /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string msixPackageFullName, Can /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = nu /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(int? pageSize = null, bool? /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task> ExistsAsync(string msixPackageFullName /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string msixPackageFullName, CancellationTok /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageData.cs index c4e0c4809990..6829153f3211 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageData.cs @@ -71,7 +71,7 @@ public MsixPackageData() /// Specifies how to register Package in feed. /// Make this version of the package the active one across the hostpool. /// List of package dependencies. - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. /// Date Package was last updated, found in the appxmanifest.xml. /// List of package applications. /// Keeps track of any properties unknown to the library. @@ -115,7 +115,7 @@ internal MsixPackageData(ResourceIdentifier id, string name, ResourceType resour /// List of package dependencies. [WirePath("properties.packageDependencies")] public IList PackageDependencies { get; } - /// Package version found in the appxmanifest.xml. + /// Package Version found in the appxmanifest.xml. [WirePath("properties.version")] public string Version { get; set; } /// Date Package was last updated, found in the appxmanifest.xml. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageResource.cs index 01d98bc9d831..0711e71fccd0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/MsixPackageResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(MsixPackage /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ActiveSessionHostConfigurationsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ActiveSessionHostConfigurationsRestOperations.cs new file mode 100644 index 000000000000..c07d2db08b6f --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ActiveSessionHostConfigurationsRestOperations.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class ActiveSessionHostConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ActiveSessionHostConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ActiveSessionHostConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/activeSessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/activeSessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ActiveSessionHostConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ActiveSessionHostConfigurationData.DeserializeActiveSessionHostConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ActiveSessionHostConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update operations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ActiveSessionHostConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ActiveSessionHostConfigurationData.DeserializeActiveSessionHostConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ActiveSessionHostConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByHostPoolRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/activeSessionHostConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/activeSessionHostConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List activeSessionHostConfigurations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ActiveSessionHostConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ActiveSessionHostConfigurationList.DeserializeActiveSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List activeSessionHostConfigurations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ActiveSessionHostConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ActiveSessionHostConfigurationList.DeserializeActiveSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByHostPoolNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByHostPoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List activeSessionHostConfigurations. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ActiveSessionHostConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ActiveSessionHostConfigurationList.DeserializeActiveSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List activeSessionHostConfigurations. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ActiveSessionHostConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ActiveSessionHostConfigurationList.DeserializeActiveSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageInfoRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageInfoRestOperations.cs index 6f92bb2b932d..f23635699423 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageInfoRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageInfoRestOperations.cs @@ -32,7 +32,7 @@ public AppAttachPackageInfoRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageRestOperations.cs index 340b27a8f331..9715790d570e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/AppAttachPackageRestOperations.cs @@ -32,7 +32,7 @@ public AppAttachPackageRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,7 +73,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Get an app attach package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +104,7 @@ public async Task> GetAsync(string subscriptionId /// Get an app attach package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -173,7 +173,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Create or update an App Attach package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// Object containing App Attach Package definitions. /// The cancellation token to use. /// , , or is null. @@ -205,7 +205,7 @@ public async Task> CreateOrUpdateAsync(string sub /// Create or update an App Attach package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// Object containing App Attach Package definitions. /// The cancellation token to use. /// , , or is null. @@ -234,7 +234,7 @@ public Response CreateOrUpdate(string subscriptionId, stri } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string appAttachPackageName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string appAttachPackageName, bool? force) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -245,10 +245,14 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath("/providers/Microsoft.DesktopVirtualization/appAttachPackages/", false); uri.AppendPath(appAttachPackageName, true); uri.AppendQuery("api-version", _apiVersion, true); + if (force != null) + { + uri.AppendQuery("force", force.Value, true); + } return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string appAttachPackageName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string appAttachPackageName, bool? force) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -262,6 +266,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath("/providers/Microsoft.DesktopVirtualization/appAttachPackages/", false); uri.AppendPath(appAttachPackageName, true); uri.AppendQuery("api-version", _apiVersion, true); + if (force != null) + { + uri.AppendQuery("force", force.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -271,17 +279,18 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Remove an App Attach Package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. + /// Force flag to delete App Attach package. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string appAttachPackageName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string appAttachPackageName, bool? force = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(appAttachPackageName, nameof(appAttachPackageName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, appAttachPackageName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, appAttachPackageName, force); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -296,17 +305,18 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Remove an App Attach Package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. + /// Force flag to delete App Attach package. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string appAttachPackageName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string appAttachPackageName, bool? force = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(appAttachPackageName, nameof(appAttachPackageName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, appAttachPackageName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, appAttachPackageName, force); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -359,7 +369,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Update an App Attach Package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// Object containing App Attach Package definition. /// The cancellation token to use. /// , , or is null. @@ -390,7 +400,7 @@ public async Task> UpdateAsync(string subscriptio /// Update an App Attach Package. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the App Attach package. + /// The name of the App Attach package arm object. /// Object containing App Attach Package definition. /// The cancellation token to use. /// , , or is null. @@ -461,7 +471,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str /// List App Attach packages in resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// OData filter expression. Valid properties for filtering are package name and host pool. + /// OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -489,7 +499,7 @@ public async Task> ListByResourceGroupAsync(strin /// List App Attach packages in resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// OData filter expression. Valid properties for filtering are package name and host pool. + /// OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -552,7 +562,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, stri /// List App Attach packages in subscription. /// The ID of the target subscription. The value must be an UUID. - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -578,7 +588,7 @@ public async Task> ListBySubscriptionAsync(string /// List App Attach packages in subscription. /// The ID of the target subscription. The value must be an UUID. - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -628,7 +638,7 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// OData filter expression. Valid properties for filtering are package name and host pool. + /// OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -658,7 +668,7 @@ public async Task> ListByResourceGroupNextPageAsy /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// OData filter expression. Valid properties for filtering are package name and host pool. + /// OData filter expression. Valid properties for filtering are package name, host pool, package owner name, and custom data. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -709,7 +719,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// List App Attach packages in subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -737,7 +747,7 @@ public async Task> ListBySubscriptionNextPageAsyn /// List App Attach packages in subscription. /// The URL to the next page of results. /// The ID of the target subscription. The value must be an UUID. - /// OData filter expression. Valid properties for filtering are package name, host pool, and resource group. + /// OData filter expression. Valid properties for filtering are package name, resource group, host pool, package owner name, and custom data. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs index c8a94e098c92..104de72d18f4 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationGroupsRestOperations.cs @@ -32,7 +32,7 @@ public ApplicationGroupsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs index cb015b5c6815..1ae90f6cd599 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ApplicationsRestOperations.cs @@ -32,7 +32,7 @@ public ApplicationsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ControlSessionHostUpdateRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ControlSessionHostUpdateRestOperations.cs new file mode 100644 index 000000000000..a453744f65da --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ControlSessionHostUpdateRestOperations.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class ControlSessionHostUpdateRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ControlSessionHostUpdateRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ControlSessionHostUpdateRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, HostPoolUpdateControlParameter hostPoolUpdateControlParameter) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default/controlSessionHostUpdate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string hostPoolName, HostPoolUpdateControlParameter hostPoolUpdateControlParameter) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default/controlSessionHostUpdate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(hostPoolUpdateControlParameter, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Control update of a hostpool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing control action for hostpool update. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task PostAsync(string subscriptionId, string resourceGroupName, string hostPoolName, HostPoolUpdateControlParameter hostPoolUpdateControlParameter, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(hostPoolUpdateControlParameter, nameof(hostPoolUpdateControlParameter)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, hostPoolName, hostPoolUpdateControlParameter); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Control update of a hostpool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing control action for hostpool update. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, string resourceGroupName, string hostPoolName, HostPoolUpdateControlParameter hostPoolUpdateControlParameter, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(hostPoolUpdateControlParameter, nameof(hostPoolUpdateControlParameter)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, hostPoolName, hostPoolUpdateControlParameter); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs index 1e341e7c747c..36f6eac6a5d9 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/DesktopsRestOperations.cs @@ -32,7 +32,7 @@ public DesktopsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs index 26c0462f2b1c..ee9c56096e21 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/HostPoolsRestOperations.cs @@ -32,7 +32,7 @@ public HostPoolsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -746,6 +746,100 @@ public Response RetrieveRegistrationToken(string subsc } } + internal RequestUriBuilder CreateListRegistrationTokensRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/listRegistrationTokens", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRegistrationTokensRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/listRegistrationTokens", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Operation to list the RegistrationTokens associated with the HostPool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListRegistrationTokensAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListRegistrationTokensRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RegistrationTokenList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RegistrationTokenList.DeserializeRegistrationTokenList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Operation to list the RegistrationTokens associated with the HostPool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListRegistrationTokens(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListRegistrationTokensRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RegistrationTokenList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RegistrationTokenList.DeserializeRegistrationTokenList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, int? pageSize, bool? isDescending, int? initialSkip) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/InitiateSessionHostUpdateRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/InitiateSessionHostUpdateRestOperations.cs new file mode 100644 index 000000000000..e5c4b97c7eb8 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/InitiateSessionHostUpdateRestOperations.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class InitiateSessionHostUpdateRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of InitiateSessionHostUpdateRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public InitiateSessionHostUpdateRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, UpdateSessionHostsRequestBody updateSessionHostsRequestBody) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default/initiateSessionHostUpdate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string hostPoolName, UpdateSessionHostsRequestBody updateSessionHostsRequestBody) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default/initiateSessionHostUpdate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (updateSessionHostsRequestBody != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(updateSessionHostsRequestBody, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Initiates a hostpool update or schedule an update for the future. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing the definition for properties to be used in the sessionHostUpdate validation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task PostAsync(string subscriptionId, string resourceGroupName, string hostPoolName, UpdateSessionHostsRequestBody updateSessionHostsRequestBody = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, hostPoolName, updateSessionHostsRequestBody); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Initiates a hostpool update or schedule an update for the future. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing the definition for properties to be used in the sessionHostUpdate validation. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, string resourceGroupName, string hostPoolName, UpdateSessionHostsRequestBody updateSessionHostsRequestBody = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, hostPoolName, updateSessionHostsRequestBody); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs index 312e0c8514a8..85dbbdef26be 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixImagesRestOperations.cs @@ -32,7 +32,7 @@ public MsixImagesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs index 1a34d4570d01..3113704a4a4e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/MsixPackagesRestOperations.cs @@ -32,7 +32,7 @@ public MsixPackagesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index d75f293b623d..6b0e8a631547 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index b7bc85b86fa6..c1311f3195a0 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs index 8f93254a48f0..7512ee83a0bd 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPersonalSchedulesRestOperations.cs @@ -32,7 +32,7 @@ public ScalingPlanPersonalSchedulesRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs index 077d35f08b34..99a7b6c82cbc 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlanPooledSchedulesRestOperations.cs @@ -32,7 +32,7 @@ public ScalingPlanPooledSchedulesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs index 3a628eff8c03..4068d5476871 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/ScalingPlansRestOperations.cs @@ -32,7 +32,7 @@ public ScalingPlansRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostConfigurationsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostConfigurationsRestOperations.cs new file mode 100644 index 000000000000..3ea02ea39950 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostConfigurationsRestOperations.cs @@ -0,0 +1,503 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class SessionHostConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SessionHostConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SessionHostConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a SessionHostConfiguration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a SessionHostConfiguration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a SessionHostConfiguration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a SessionHostConfiguration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SessionHostConfiguration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostConfigurationData.DeserializeSessionHostConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SessionHostConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SessionHostConfiguration. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostConfigurationData.DeserializeSessionHostConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SessionHostConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByHostPoolRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List sessionHostConfigurations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostConfigurationList.DeserializeSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List sessionHostConfigurations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostConfigurationList.DeserializeSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByHostPoolNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByHostPoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List sessionHostConfigurations. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostConfigurationList.DeserializeSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List sessionHostConfigurations. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostConfigurationList.DeserializeSessionHostConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostManagementsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostManagementsRestOperations.cs new file mode 100644 index 000000000000..d159b8a8d763 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostManagementsRestOperations.cs @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class SessionHostManagementsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SessionHostManagementsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SessionHostManagementsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a SessionHostManagement. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostManagementData.DeserializeSessionHostManagementData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SessionHostManagementData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a SessionHostManagement. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostManagementData.DeserializeSessionHostManagementData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SessionHostManagementData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a SessionHostManagement. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + SessionHostManagementData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostManagementData.DeserializeSessionHostManagementData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a SessionHostManagement. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + SessionHostManagementData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostManagementData.DeserializeSessionHostManagementData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a SessionHostManagement. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostManagementData.DeserializeSessionHostManagementData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a SessionHostManagement. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string hostPoolName, SessionHostManagementPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, hostPoolName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostManagementData.DeserializeSessionHostManagementData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByHostPoolRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByHostPoolRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SessionHostManagements by hostPool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostManagementList.DeserializeSessionHostManagementList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SessionHostManagements by hostPool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPool(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostManagementList.DeserializeSessionHostManagementList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByHostPoolNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByHostPoolNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List SessionHostManagements by hostPool. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByHostPoolNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostManagementList.DeserializeSessionHostManagementList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List SessionHostManagements by hostPool. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByHostPoolNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateListByHostPoolNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostManagementList.DeserializeSessionHostManagementList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostManagementsUpdateStatusRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostManagementsUpdateStatusRestOperations.cs new file mode 100644 index 000000000000..93106c653b0b --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostManagementsUpdateStatusRestOperations.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class SessionHostManagementsUpdateStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SessionHostManagementsUpdateStatusRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SessionHostManagementsUpdateStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default/sessionHostUpdateStatuses/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHostManagements/default/sessionHostUpdateStatuses/default", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the session host update status for a given hostpool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementUpdateStatus value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SessionHostManagementUpdateStatus.DeserializeSessionHostManagementUpdateStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the session host update status for a given hostpool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string hostPoolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, hostPoolName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SessionHostManagementUpdateStatus value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SessionHostManagementUpdateStatus.DeserializeSessionHostManagementUpdateStatus(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostRestOperations.cs new file mode 100644 index 000000000000..0f759b94cf30 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostRestOperations.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + internal partial class SessionHostRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SessionHostRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public SessionHostRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-08-08-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateRetryProvisioningRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, string sessionHostName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHosts/", false); + uri.AppendPath(sessionHostName, true); + uri.AppendPath("/retryProvisioning", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRetryProvisioningRequest(string subscriptionId, string resourceGroupName, string hostPoolName, string sessionHostName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DesktopVirtualization/hostPools/", false); + uri.AppendPath(hostPoolName, true); + uri.AppendPath("/sessionHosts/", false); + uri.AppendPath(sessionHostName, true); + uri.AppendPath("/retryProvisioning", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Retry provisioning on a SessionHost. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the session host within the specified host pool. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RetryProvisioningAsync(string subscriptionId, string resourceGroupName, string hostPoolName, string sessionHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(sessionHostName, nameof(sessionHostName)); + + using var message = CreateRetryProvisioningRequest(subscriptionId, resourceGroupName, hostPoolName, sessionHostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Retry provisioning on a SessionHost. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the host pool within the specified resource group. + /// The name of the session host within the specified host pool. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RetryProvisioning(string subscriptionId, string resourceGroupName, string hostPoolName, string sessionHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); + Argument.AssertNotNullOrEmpty(sessionHostName, nameof(sessionHostName)); + + using var message = CreateRetryProvisioningRequest(subscriptionId, resourceGroupName, hostPoolName, sessionHostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs index 7014aa7a06e4..3733bd5173be 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/SessionHostsRestOperations.cs @@ -32,7 +32,7 @@ public SessionHostsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -360,7 +360,7 @@ public Response Update(string subscriptionId, string resourceGr } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip, string vmPath) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -384,10 +384,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re { uri.AppendQuery("initialSkip", initialSkip.Value, true); } + if (vmPath != null) + { + uri.AppendQuery("vmPath", vmPath, true); + } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip, string vmPath) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -414,6 +418,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro { uri.AppendQuery("initialSkip", initialSkip.Value, true); } + if (vmPath != null) + { + uri.AppendQuery("vmPath", vmPath, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -427,16 +435,17 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Number of items per page. /// Indicates whether the collection is descending. /// Initial number of items to skip. + /// The path to the VM. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, string vmPath = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + using var message = CreateListRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -459,16 +468,17 @@ public async Task> ListAsync(string subscriptionId, st /// Number of items per page. /// Indicates whether the collection is descending. /// Initial number of items to skip. + /// The path to the VM. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, string vmPath = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + using var message = CreateListRequest(subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -484,7 +494,7 @@ public Response List(string subscriptionId, string resourceGrou } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip, string vmPath) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -492,7 +502,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize, bool? isDescending, int? initialSkip, string vmPath) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -514,17 +524,18 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Number of items per page. /// Indicates whether the collection is descending. /// Initial number of items to skip. + /// The path to the VM. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, string vmPath = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -548,17 +559,18 @@ public async Task> ListNextPageAsync(string nextLink, /// Number of items per page. /// Indicates whether the collection is descending. /// Initial number of items to skip. + /// The path to the VM. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string hostPoolName, int? pageSize = null, bool? isDescending = null, int? initialSkip = null, string vmPath = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(hostPoolName, nameof(hostPoolName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, vmPath); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs index bd9c1a2e0e71..34a50b9976a6 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/StartMenuItemsRestOperations.cs @@ -32,7 +32,7 @@ public StartMenuItemsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs index c16ae46a8919..089750982ad6 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/UserSessionsRestOperations.cs @@ -32,7 +32,7 @@ public UserSessionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs index 31ab9c02f039..4e4e3e3cd6f6 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/RestOperations/WorkspacesRestOperations.cs @@ -32,7 +32,7 @@ public WorkspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-04-03"; + _apiVersion = apiVersion ?? "2024-08-08-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanCollection.cs index 31db3f619312..e0e92437411e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string scaling /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string scalingPlanName, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = nu /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(int? pageSize = null, bool? /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string scalingPlanName, Ca /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string scalingPlanName, CancellationToken c /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.Serialization.cs index 37bc1e1e08c9..b12744586344 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.Serialization.cs @@ -57,7 +57,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); } if (Optional.IsDefined(Sku)) { @@ -194,7 +195,8 @@ internal static ScalingPlanData DeserializeScalingPlanData(JsonElement element, { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } if (property.NameEquals("sku"u8)) diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.cs index 1590791c9bb0..599085408477 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanData.cs @@ -77,14 +77,14 @@ public ScalingPlanData(AzureLocation location, string timeZone) : base(location) /// Timezone of the scaling plan. /// HostPool type for desktop. /// Exclusion tag for scaling plan. - /// List of ScalingPlanPooledSchedule definitions. + /// List of Pooled ScalingSchedule definitions. /// List of ScalingHostPoolReference definitions. /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// Keeps track of any properties unknown to the library. internal ScalingPlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, string timeZone, ScalingHostPoolType? scalingHostPoolType, string exclusionTag, IList schedules, IList hostPoolReferences, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -128,7 +128,7 @@ internal ScalingPlanData() /// Exclusion tag for scaling plan. [WirePath("properties.exclusionTag")] public string ExclusionTag { get; set; } - /// List of ScalingPlanPooledSchedule definitions. + /// List of Pooled ScalingSchedule definitions. [WirePath("properties.schedules")] public IList Schedules { get; } /// List of ScalingHostPoolReference definitions. @@ -143,13 +143,13 @@ internal ScalingPlanData() /// The etag field is *not* required. If it is provided in the response body, it must 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. [WirePath("etag")] public ETag? ETag { get; } - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// The resource model definition representing SKU. [WirePath("sku")] public DesktopVirtualizationSku Sku { get; set; } - /// Gets or sets the plan. + /// Plan for the resource. [WirePath("plan")] public ArmPlan Plan { get; set; } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs index 68505be93e0a..9b8cebd9419a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string scalingP /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(in /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(int? pageSiz /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task> ExistsAsync(string scalingPlanSchedule /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string scalingPlanScheduleName, Cancellatio /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.Serialization.cs index 2895c6710a46..beafe7d26a21 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.Serialization.cs @@ -41,21 +41,15 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsCollectionDefined(DaysOfWeek)) + writer.WritePropertyName("daysOfWeek"u8); + writer.WriteStartArray(); + foreach (var item in DaysOfWeek) { - writer.WritePropertyName("daysOfWeek"u8); - writer.WriteStartArray(); - foreach (var item in DaysOfWeek) - { - writer.WriteStringValue(item.ToSerialString()); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(RampUpStartTime)) - { - writer.WritePropertyName("rampUpStartTime"u8); - writer.WriteObjectValue(RampUpStartTime, options); + writer.WriteStringValue(item.ToSerialString()); } + writer.WriteEndArray(); + writer.WritePropertyName("rampUpStartTime"u8); + writer.WriteObjectValue(RampUpStartTime, options); if (Optional.IsDefined(RampUpAutoStartHosts)) { writer.WritePropertyName("rampUpAutoStartHosts"u8); @@ -86,11 +80,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("rampUpMinutesToWaitOnLogoff"u8); writer.WriteNumberValue(RampUpMinutesToWaitOnLogoff.Value); } - if (Optional.IsDefined(PeakStartTime)) - { - writer.WritePropertyName("peakStartTime"u8); - writer.WriteObjectValue(PeakStartTime, options); - } + writer.WritePropertyName("peakStartTime"u8); + writer.WriteObjectValue(PeakStartTime, options); if (Optional.IsDefined(PeakStartVmOnConnect)) { writer.WritePropertyName("peakStartVMOnConnect"u8); @@ -116,11 +107,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("peakMinutesToWaitOnLogoff"u8); writer.WriteNumberValue(PeakMinutesToWaitOnLogoff.Value); } - if (Optional.IsDefined(RampDownStartTime)) - { - writer.WritePropertyName("rampDownStartTime"u8); - writer.WriteObjectValue(RampDownStartTime, options); - } + writer.WritePropertyName("rampDownStartTime"u8); + writer.WriteObjectValue(RampDownStartTime, options); if (Optional.IsDefined(RampDownStartVmOnConnect)) { writer.WritePropertyName("rampDownStartVMOnConnect"u8); @@ -146,11 +134,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("rampDownMinutesToWaitOnLogoff"u8); writer.WriteNumberValue(RampDownMinutesToWaitOnLogoff.Value); } - if (Optional.IsDefined(OffPeakStartTime)) - { - writer.WritePropertyName("offPeakStartTime"u8); - writer.WriteObjectValue(OffPeakStartTime, options); - } + writer.WritePropertyName("offPeakStartTime"u8); + writer.WriteObjectValue(OffPeakStartTime, options); if (Optional.IsDefined(OffPeakStartVmOnConnect)) { writer.WritePropertyName("offPeakStartVMOnConnect"u8); @@ -268,10 +253,6 @@ internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalSc { if (property0.NameEquals("daysOfWeek"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { @@ -282,10 +263,6 @@ internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalSc } if (property0.NameEquals("rampUpStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } rampUpStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -345,10 +322,6 @@ internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalSc } if (property0.NameEquals("peakStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } peakStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -399,10 +372,6 @@ internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalSc } if (property0.NameEquals("rampDownStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } rampDownStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -453,10 +422,6 @@ internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalSc } if (property0.NameEquals("offPeakStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } offPeakStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -519,7 +484,7 @@ internal static ScalingPlanPersonalScheduleData DeserializeScalingPlanPersonalSc name, type, systemData, - daysOfWeek ?? new ChangeTrackingList(), + daysOfWeek, rampUpStartTime, rampUpAutoStartHosts, rampUpStartVmOnConnect, diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs index 761dd707af80..423213f0ed3c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleData.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.DesktopVirtualization.Models; using Azure.ResourceManager.Models; @@ -52,9 +53,25 @@ public partial class ScalingPlanPersonalScheduleData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ScalingPlanPersonalScheduleData() + /// Set of days of the week on which this schedule is active. + /// Starting time for ramp up period. + /// Starting time for peak period. + /// Starting time for ramp down period. + /// Starting time for off-peak period. + /// , , , or is null. + public ScalingPlanPersonalScheduleData(IEnumerable daysOfWeek, ScalingActionTime rampUpStartTime, ScalingActionTime peakStartTime, ScalingActionTime rampDownStartTime, ScalingActionTime offPeakStartTime) { - DaysOfWeek = new ChangeTrackingList(); + Argument.AssertNotNull(daysOfWeek, nameof(daysOfWeek)); + Argument.AssertNotNull(rampUpStartTime, nameof(rampUpStartTime)); + Argument.AssertNotNull(peakStartTime, nameof(peakStartTime)); + Argument.AssertNotNull(rampDownStartTime, nameof(rampDownStartTime)); + Argument.AssertNotNull(offPeakStartTime, nameof(offPeakStartTime)); + + DaysOfWeek = daysOfWeek.ToList(); + RampUpStartTime = rampUpStartTime; + PeakStartTime = peakStartTime; + RampDownStartTime = rampDownStartTime; + OffPeakStartTime = offPeakStartTime; } /// Initializes a new instance of . @@ -120,6 +137,11 @@ internal ScalingPlanPersonalScheduleData(ResourceIdentifier id, string name, Res _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ScalingPlanPersonalScheduleData() + { + } + /// Set of days of the week on which this schedule is active. [WirePath("properties.daysOfWeek")] public IList DaysOfWeek { get; } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs index 4b281661f966..467737ae778d 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPersonalScheduleResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleCollection.cs index d05cbd661d11..bcb9a8edd2c9 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> Creat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(Wa /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string scalingPla /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(int? /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(int? pageSize /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task> ExistsAsync(string scalingPlanSchedule /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string scalingPlanScheduleName, Cancellatio /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.Serialization.cs index 43bbb6ae6da5..8be2122bee0e 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.Serialization.cs @@ -41,21 +41,20 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsCollectionDefined(DaysOfWeek)) + if (options.Format != "W" && Optional.IsDefined(NamePropertiesName)) { - writer.WritePropertyName("daysOfWeek"u8); - writer.WriteStartArray(); - foreach (var item in DaysOfWeek) - { - writer.WriteStringValue(item.ToSerialString()); - } - writer.WriteEndArray(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(NamePropertiesName); } - if (Optional.IsDefined(RampUpStartTime)) + writer.WritePropertyName("daysOfWeek"u8); + writer.WriteStartArray(); + foreach (var item in DaysOfWeek) { - writer.WritePropertyName("rampUpStartTime"u8); - writer.WriteObjectValue(RampUpStartTime, options); + writer.WriteStringValue(item.ToSerialString()); } + writer.WriteEndArray(); + writer.WritePropertyName("rampUpStartTime"u8); + writer.WriteObjectValue(RampUpStartTime, options); if (Optional.IsDefined(RampUpLoadBalancingAlgorithm)) { writer.WritePropertyName("rampUpLoadBalancingAlgorithm"u8); @@ -66,26 +65,17 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("rampUpMinimumHostsPct"u8); writer.WriteNumberValue(RampUpMinimumHostsPct.Value); } - if (Optional.IsDefined(RampUpCapacityThresholdPct)) - { - writer.WritePropertyName("rampUpCapacityThresholdPct"u8); - writer.WriteNumberValue(RampUpCapacityThresholdPct.Value); - } - if (Optional.IsDefined(PeakStartTime)) - { - writer.WritePropertyName("peakStartTime"u8); - writer.WriteObjectValue(PeakStartTime, options); - } + writer.WritePropertyName("rampUpCapacityThresholdPct"u8); + writer.WriteNumberValue(RampUpCapacityThresholdPct); + writer.WritePropertyName("peakStartTime"u8); + writer.WriteObjectValue(PeakStartTime, options); if (Optional.IsDefined(PeakLoadBalancingAlgorithm)) { writer.WritePropertyName("peakLoadBalancingAlgorithm"u8); writer.WriteStringValue(PeakLoadBalancingAlgorithm.Value.ToString()); } - if (Optional.IsDefined(RampDownStartTime)) - { - writer.WritePropertyName("rampDownStartTime"u8); - writer.WriteObjectValue(RampDownStartTime, options); - } + writer.WritePropertyName("rampDownStartTime"u8); + writer.WriteObjectValue(RampDownStartTime, options); if (Optional.IsDefined(RampDownLoadBalancingAlgorithm)) { writer.WritePropertyName("rampDownLoadBalancingAlgorithm"u8); @@ -96,11 +86,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("rampDownMinimumHostsPct"u8); writer.WriteNumberValue(RampDownMinimumHostsPct.Value); } - if (Optional.IsDefined(RampDownCapacityThresholdPct)) - { - writer.WritePropertyName("rampDownCapacityThresholdPct"u8); - writer.WriteNumberValue(RampDownCapacityThresholdPct.Value); - } + writer.WritePropertyName("rampDownCapacityThresholdPct"u8); + writer.WriteNumberValue(RampDownCapacityThresholdPct); if (Optional.IsDefined(RampDownForceLogoffUsers)) { writer.WritePropertyName("rampDownForceLogoffUsers"u8); @@ -121,11 +108,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("rampDownNotificationMessage"u8); writer.WriteStringValue(RampDownNotificationMessage); } - if (Optional.IsDefined(OffPeakStartTime)) - { - writer.WritePropertyName("offPeakStartTime"u8); - writer.WriteObjectValue(OffPeakStartTime, options); - } + writer.WritePropertyName("offPeakStartTime"u8); + writer.WriteObjectValue(OffPeakStartTime, options); if (Optional.IsDefined(OffPeakLoadBalancingAlgorithm)) { writer.WritePropertyName("offPeakLoadBalancingAlgorithm"u8); @@ -158,17 +142,18 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu string name = default; ResourceType type = default; SystemData systemData = default; + string name0 = default; IList daysOfWeek = default; ScalingActionTime rampUpStartTime = default; SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm = default; int? rampUpMinimumHostsPct = default; - int? rampUpCapacityThresholdPct = default; + int rampUpCapacityThresholdPct = default; ScalingActionTime peakStartTime = default; SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm = default; ScalingActionTime rampDownStartTime = default; SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm = default; int? rampDownMinimumHostsPct = default; - int? rampDownCapacityThresholdPct = default; + int rampDownCapacityThresholdPct = default; bool? rampDownForceLogoffUsers = default; DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen = default; int? rampDownWaitTimeMinutes = default; @@ -212,12 +197,13 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu } foreach (var property0 in property.Value.EnumerateObject()) { + if (property0.NameEquals("name"u8)) + { + name0 = property0.Value.GetString(); + continue; + } if (property0.NameEquals("daysOfWeek"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { @@ -228,10 +214,6 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu } if (property0.NameEquals("rampUpStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } rampUpStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -255,19 +237,11 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu } if (property0.NameEquals("rampUpCapacityThresholdPct"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } rampUpCapacityThresholdPct = property0.Value.GetInt32(); continue; } if (property0.NameEquals("peakStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } peakStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -282,10 +256,6 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu } if (property0.NameEquals("rampDownStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } rampDownStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -309,10 +279,6 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu } if (property0.NameEquals("rampDownCapacityThresholdPct"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } rampDownCapacityThresholdPct = property0.Value.GetInt32(); continue; } @@ -350,10 +316,6 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu } if (property0.NameEquals("offPeakStartTime"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } offPeakStartTime = ScalingActionTime.DeserializeScalingActionTime(property0.Value, options); continue; } @@ -380,7 +342,8 @@ internal static ScalingPlanPooledScheduleData DeserializeScalingPlanPooledSchedu name, type, systemData, - daysOfWeek ?? new ChangeTrackingList(), + name0, + daysOfWeek, rampUpStartTime, rampUpLoadBalancingAlgorithm, rampUpMinimumHostsPct, @@ -466,6 +429,29 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append(" properties:"); builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NamePropertiesName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NamePropertiesName)) + { + builder.Append(" name: "); + if (NamePropertiesName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{NamePropertiesName}'''"); + } + else + { + builder.AppendLine($"'{NamePropertiesName}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DaysOfWeek), out propertyOverride); if (hasPropertyOverride) { @@ -542,11 +528,8 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - if (Optional.IsDefined(RampUpCapacityThresholdPct)) - { - builder.Append(" rampUpCapacityThresholdPct: "); - builder.AppendLine($"{RampUpCapacityThresholdPct.Value}"); - } + builder.Append(" rampUpCapacityThresholdPct: "); + builder.AppendLine($"{RampUpCapacityThresholdPct}"); } hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeakStartTime), out propertyOverride); @@ -632,11 +615,8 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - if (Optional.IsDefined(RampDownCapacityThresholdPct)) - { - builder.Append(" rampDownCapacityThresholdPct: "); - builder.AppendLine($"{RampDownCapacityThresholdPct.Value}"); - } + builder.Append(" rampDownCapacityThresholdPct: "); + builder.AppendLine($"{RampDownCapacityThresholdPct}"); } hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RampDownForceLogoffUsers), out propertyOverride); diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.cs index 8fb91ded38fd..640b854467a6 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleData.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Azure.Core; using Azure.ResourceManager.DesktopVirtualization.Models; using Azure.ResourceManager.Models; @@ -52,9 +53,29 @@ public partial class ScalingPlanPooledScheduleData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ScalingPlanPooledScheduleData() + /// Set of days of the week on which this schedule is active. + /// Starting time for ramp up period. + /// Capacity threshold for ramp up period. + /// Starting time for peak period. + /// Starting time for ramp down period. + /// Capacity threshold for ramp down period. + /// Starting time for off-peak period. + /// , , , or is null. + public ScalingPlanPooledScheduleData(IEnumerable daysOfWeek, ScalingActionTime rampUpStartTime, int rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, ScalingActionTime rampDownStartTime, int rampDownCapacityThresholdPct, ScalingActionTime offPeakStartTime) { - DaysOfWeek = new ChangeTrackingList(); + Argument.AssertNotNull(daysOfWeek, nameof(daysOfWeek)); + Argument.AssertNotNull(rampUpStartTime, nameof(rampUpStartTime)); + Argument.AssertNotNull(peakStartTime, nameof(peakStartTime)); + Argument.AssertNotNull(rampDownStartTime, nameof(rampDownStartTime)); + Argument.AssertNotNull(offPeakStartTime, nameof(offPeakStartTime)); + + DaysOfWeek = daysOfWeek.ToList(); + RampUpStartTime = rampUpStartTime; + RampUpCapacityThresholdPct = rampUpCapacityThresholdPct; + PeakStartTime = peakStartTime; + RampDownStartTime = rampDownStartTime; + RampDownCapacityThresholdPct = rampDownCapacityThresholdPct; + OffPeakStartTime = offPeakStartTime; } /// Initializes a new instance of . @@ -62,6 +83,7 @@ public ScalingPlanPooledScheduleData() /// The name. /// The resourceType. /// The systemData. + /// Name of the ScalingPlanPooledSchedule. /// Set of days of the week on which this schedule is active. /// Starting time for ramp up period. /// Load balancing algorithm for ramp up period. @@ -80,8 +102,9 @@ public ScalingPlanPooledScheduleData() /// Starting time for off-peak period. /// Load balancing algorithm for off-peak period. /// Keeps track of any properties unknown to the library. - internal ScalingPlanPooledScheduleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int? rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int? rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ScalingPlanPooledScheduleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string namePropertiesName, IList daysOfWeek, ScalingActionTime rampUpStartTime, SessionHostLoadBalancingAlgorithm? rampUpLoadBalancingAlgorithm, int? rampUpMinimumHostsPct, int rampUpCapacityThresholdPct, ScalingActionTime peakStartTime, SessionHostLoadBalancingAlgorithm? peakLoadBalancingAlgorithm, ScalingActionTime rampDownStartTime, SessionHostLoadBalancingAlgorithm? rampDownLoadBalancingAlgorithm, int? rampDownMinimumHostsPct, int rampDownCapacityThresholdPct, bool? rampDownForceLogoffUsers, DesktopVirtualizationStopHostsWhen? rampDownStopHostsWhen, int? rampDownWaitTimeMinutes, string rampDownNotificationMessage, ScalingActionTime offPeakStartTime, SessionHostLoadBalancingAlgorithm? offPeakLoadBalancingAlgorithm, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { + NamePropertiesName = namePropertiesName; DaysOfWeek = daysOfWeek; RampUpStartTime = rampUpStartTime; RampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm; @@ -102,6 +125,14 @@ internal ScalingPlanPooledScheduleData(ResourceIdentifier id, string name, Resou _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Initializes a new instance of for deserialization. + internal ScalingPlanPooledScheduleData() + { + } + + /// Name of the ScalingPlanPooledSchedule. + [WirePath("properties.name")] + public string NamePropertiesName { get; } /// Set of days of the week on which this schedule is active. [WirePath("properties.daysOfWeek")] public IList DaysOfWeek { get; } @@ -116,7 +147,7 @@ internal ScalingPlanPooledScheduleData(ResourceIdentifier id, string name, Resou public int? RampUpMinimumHostsPct { get; set; } /// Capacity threshold for ramp up period. [WirePath("properties.rampUpCapacityThresholdPct")] - public int? RampUpCapacityThresholdPct { get; set; } + public int RampUpCapacityThresholdPct { get; set; } /// Starting time for peak period. [WirePath("properties.peakStartTime")] public ScalingActionTime PeakStartTime { get; set; } @@ -134,7 +165,7 @@ internal ScalingPlanPooledScheduleData(ResourceIdentifier id, string name, Resou public int? RampDownMinimumHostsPct { get; set; } /// Capacity threshold for ramp down period. [WirePath("properties.rampDownCapacityThresholdPct")] - public int? RampDownCapacityThresholdPct { get; set; } + public int RampDownCapacityThresholdPct { get; set; } /// Should users be logged off forcefully from hosts. [WirePath("properties.rampDownForceLogoffUsers")] public bool? RampDownForceLogoffUsers { get; set; } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleResource.cs index b18eecd4a47e..48d4beaf2514 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanPooledScheduleResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync( /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs index 71ccaf7c9ef1..e824e3790d86 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/ScalingPlanResource.cs @@ -110,7 +110,7 @@ public virtual ScalingPlanPooledScheduleCollection GetScalingPlanPooledSchedules /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetScalin /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -179,7 +179,7 @@ public virtual ScalingPlanPersonalScheduleCollection GetScalingPlanPersonalSched /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetScal /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -241,7 +241,7 @@ public virtual Response GetScalingPlanPerso /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -281,7 +281,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -321,7 +321,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -451,7 +451,7 @@ public virtual async Task> UpdateAsync(ScalingPlan /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -493,7 +493,7 @@ public virtual Response Update(ScalingPlanPatch patch, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -555,7 +555,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -617,7 +617,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -674,7 +674,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -731,7 +731,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -791,7 +791,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostCollection.cs index bb2398815538..e647561a2e31 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string session /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string sessionHostName, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -165,12 +165,13 @@ public virtual Response Get(string sessionHostName, Cancell /// Number of items per page. /// Indicates whether the collection is descending. /// Initial number of items to skip. + /// The path to the VM. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, string vmPath = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sessionHostRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sessionHostRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage FirstPageRequest(int? pageSizeHint) => _sessionHostRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip, vmPath); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sessionHostRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip, vmPath); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SessionHostResource(Client, SessionHostData.DeserializeSessionHostData(e)), _sessionHostClientDiagnostics, Pipeline, "SessionHostCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -187,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = nu /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -198,12 +199,13 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = nu /// Number of items per page. /// Indicates whether the collection is descending. /// Initial number of items to skip. + /// The path to the VM. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(int? pageSize = null, bool? isDescending = null, int? initialSkip = null, string vmPath = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sessionHostRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sessionHostRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip); + HttpMessage FirstPageRequest(int? pageSizeHint) => _sessionHostRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip, vmPath); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sessionHostRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, pageSizeHint, isDescending, initialSkip, vmPath); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SessionHostResource(Client, SessionHostData.DeserializeSessionHostData(e)), _sessionHostClientDiagnostics, Pipeline, "SessionHostCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -220,7 +222,7 @@ public virtual Pageable GetAll(int? pageSize = null, bool? /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -263,7 +265,7 @@ public virtual async Task> ExistsAsync(string sessionHostName, Ca /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -306,7 +308,7 @@ public virtual Response Exists(string sessionHostName, CancellationToken c /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -351,7 +353,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationData.Serialization.cs new file mode 100644 index 000000000000..c7ca65ccd627 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationData.Serialization.cs @@ -0,0 +1,792 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class SessionHostConfigurationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostConfigurationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version.Value, "O"); + } + if (Optional.IsDefined(FriendlyName)) + { + writer.WritePropertyName("friendlyName"u8); + writer.WriteStringValue(FriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(VmTags)) + { + writer.WritePropertyName("vmTags"u8); + writer.WriteStartObject(); + foreach (var item in VmTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(VmLocation)) + { + writer.WritePropertyName("vmLocation"u8); + writer.WriteStringValue(VmLocation); + } + if (Optional.IsDefined(VmResourceGroup)) + { + writer.WritePropertyName("vmResourceGroup"u8); + writer.WriteStringValue(VmResourceGroup); + } + writer.WritePropertyName("vmNamePrefix"u8); + writer.WriteStringValue(VmNamePrefix); + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + writer.WritePropertyName("availabilityZones"u8); + writer.WriteStartArray(); + foreach (var item in AvailabilityZones) + { + writer.WriteNumberValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("networkInfo"u8); + writer.WriteObjectValue(NetworkInfo, options); + writer.WritePropertyName("vmSizeId"u8); + writer.WriteStringValue(VmSizeId); + writer.WritePropertyName("diskInfo"u8); + writer.WriteObjectValue(DiskInfo, options); + if (Optional.IsDefined(CustomConfigurationScriptUri)) + { + writer.WritePropertyName("customConfigurationScriptUrl"u8); + writer.WriteStringValue(CustomConfigurationScriptUri.AbsoluteUri); + } + writer.WritePropertyName("imageInfo"u8); + writer.WriteObjectValue(ImageInfo, options); + writer.WritePropertyName("domainInfo"u8); + writer.WriteObjectValue(DomainInfo, options); + if (Optional.IsDefined(SecurityInfo)) + { + writer.WritePropertyName("securityInfo"u8); + writer.WriteObjectValue(SecurityInfo, options); + } + writer.WritePropertyName("vmAdminCredentials"u8); + writer.WriteObjectValue(VmAdminCredentials, options); + if (Optional.IsDefined(BootDiagnosticsInfo)) + { + writer.WritePropertyName("bootDiagnosticsInfo"u8); + writer.WriteObjectValue(BootDiagnosticsInfo, options); + } + writer.WriteEndObject(); + } + + SessionHostConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostConfigurationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostConfigurationData(document.RootElement, options); + } + + internal static SessionHostConfigurationData DeserializeSessionHostConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + DateTimeOffset? version = default; + string friendlyName = default; + ProvisioningStateSHC? provisioningState = default; + IDictionary vmTags = default; + string vmLocation = default; + string vmResourceGroup = default; + string vmNamePrefix = default; + IList availabilityZones = default; + NetworkInfoProperties networkInfo = default; + string vmSizeId = default; + DiskInfoProperties diskInfo = default; + Uri customConfigurationScriptUrl = default; + ImageInfoProperties imageInfo = default; + DomainInfoProperties domainInfo = default; + SecurityInfoProperties securityInfo = default; + KeyVaultCredentialsProperties vmAdminCredentials = default; + BootDiagnosticsInfoProperties bootDiagnosticsInfo = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("version"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("friendlyName"u8)) + { + friendlyName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningStateSHC(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("vmTags"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + vmTags = dictionary; + continue; + } + if (property0.NameEquals("vmLocation"u8)) + { + vmLocation = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmResourceGroup"u8)) + { + vmResourceGroup = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmNamePrefix"u8)) + { + vmNamePrefix = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("availabilityZones"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetInt32()); + } + availabilityZones = array; + continue; + } + if (property0.NameEquals("networkInfo"u8)) + { + networkInfo = NetworkInfoProperties.DeserializeNetworkInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("vmSizeId"u8)) + { + vmSizeId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("diskInfo"u8)) + { + diskInfo = DiskInfoProperties.DeserializeDiskInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("customConfigurationScriptUrl"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customConfigurationScriptUrl = new Uri(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("imageInfo"u8)) + { + imageInfo = ImageInfoProperties.DeserializeImageInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("domainInfo"u8)) + { + domainInfo = DomainInfoProperties.DeserializeDomainInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("securityInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityInfo = SecurityInfoProperties.DeserializeSecurityInfoProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("vmAdminCredentials"u8)) + { + vmAdminCredentials = KeyVaultCredentialsProperties.DeserializeKeyVaultCredentialsProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("bootDiagnosticsInfo"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootDiagnosticsInfo = BootDiagnosticsInfoProperties.DeserializeBootDiagnosticsInfoProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostConfigurationData( + id, + name, + type, + systemData, + version, + friendlyName, + provisioningState, + vmTags ?? new ChangeTrackingDictionary(), + vmLocation, + vmResourceGroup, + vmNamePrefix, + availabilityZones ?? new ChangeTrackingList(), + networkInfo, + vmSizeId, + diskInfo, + customConfigurationScriptUrl, + imageInfo, + domainInfo, + securityInfo, + vmAdminCredentials, + bootDiagnosticsInfo, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Version), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" version: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Version)) + { + builder.Append(" version: "); + var formattedDateTimeString = TypeFormatters.ToString(Version.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FriendlyName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" friendlyName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FriendlyName)) + { + builder.Append(" friendlyName: "); + if (FriendlyName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{FriendlyName}'''"); + } + else + { + builder.AppendLine($"'{FriendlyName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmTags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmTags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(VmTags)) + { + if (VmTags.Any()) + { + builder.Append(" vmTags: "); + builder.AppendLine("{"); + foreach (var item in VmTags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmLocation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmLocation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmLocation)) + { + builder.Append(" vmLocation: "); + if (VmLocation.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmLocation}'''"); + } + else + { + builder.AppendLine($"'{VmLocation}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmResourceGroup), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmResourceGroup: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmResourceGroup)) + { + builder.Append(" vmResourceGroup: "); + if (VmResourceGroup.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmResourceGroup}'''"); + } + else + { + builder.AppendLine($"'{VmResourceGroup}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmNamePrefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmNamePrefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmNamePrefix)) + { + builder.Append(" vmNamePrefix: "); + if (VmNamePrefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmNamePrefix}'''"); + } + else + { + builder.AppendLine($"'{VmNamePrefix}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AvailabilityZones), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" availabilityZones: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AvailabilityZones)) + { + if (AvailabilityZones.Any()) + { + builder.Append(" availabilityZones: "); + builder.AppendLine("["); + foreach (var item in AvailabilityZones) + { + builder.AppendLine($" {item}"); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NetworkInfo)) + { + builder.Append(" networkInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, NetworkInfo, options, 4, false, " networkInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmSizeId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmSizeId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmSizeId)) + { + builder.Append(" vmSizeId: "); + if (VmSizeId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{VmSizeId}'''"); + } + else + { + builder.AppendLine($"'{VmSizeId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("VirtualMachineDiskType", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diskInfo: "); + builder.AppendLine("{"); + builder.AppendLine(" diskInfo: {"); + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(DiskInfo)) + { + builder.Append(" diskInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, DiskInfo, options, 4, false, " diskInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomConfigurationScriptUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customConfigurationScriptUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CustomConfigurationScriptUri)) + { + builder.Append(" customConfigurationScriptUrl: "); + builder.AppendLine($"'{CustomConfigurationScriptUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImageInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" imageInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ImageInfo)) + { + builder.Append(" imageInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, ImageInfo, options, 4, false, " imageInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DomainInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" domainInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DomainInfo)) + { + builder.Append(" domainInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, DomainInfo, options, 4, false, " domainInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityInfo)) + { + builder.Append(" securityInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, SecurityInfo, options, 4, false, " securityInfo: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmAdminCredentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmAdminCredentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmAdminCredentials)) + { + builder.Append(" vmAdminCredentials: "); + BicepSerializationHelpers.AppendChildObject(builder, VmAdminCredentials, options, 4, false, " vmAdminCredentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BootDiagnosticsInfo), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" bootDiagnosticsInfo: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BootDiagnosticsInfo)) + { + builder.Append(" bootDiagnosticsInfo: "); + BicepSerializationHelpers.AppendChildObject(builder, BootDiagnosticsInfo, options, 4, false, " bootDiagnosticsInfo: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionHostConfigurationData)} does not support writing '{options.Format}' format."); + } + } + + SessionHostConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostConfigurationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostConfigurationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationData.cs new file mode 100644 index 000000000000..a0c508c3859e --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationData.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing the SessionHostConfiguration data model. + /// Represents a SessionHostConfiguration definition. + /// + public partial class SessionHostConfigurationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The prefix that should be associated with session host names. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Local Admin credentials for session hosts. + /// , , , , , or is null. + public SessionHostConfigurationData(string vmNamePrefix, NetworkInfoProperties networkInfo, string vmSizeId, DiskInfoProperties diskInfo, ImageInfoProperties imageInfo, DomainInfoProperties domainInfo, KeyVaultCredentialsProperties vmAdminCredentials) + { + Argument.AssertNotNull(vmNamePrefix, nameof(vmNamePrefix)); + Argument.AssertNotNull(networkInfo, nameof(networkInfo)); + Argument.AssertNotNull(vmSizeId, nameof(vmSizeId)); + Argument.AssertNotNull(diskInfo, nameof(diskInfo)); + Argument.AssertNotNull(imageInfo, nameof(imageInfo)); + Argument.AssertNotNull(domainInfo, nameof(domainInfo)); + Argument.AssertNotNull(vmAdminCredentials, nameof(vmAdminCredentials)); + + VmTags = new ChangeTrackingDictionary(); + VmNamePrefix = vmNamePrefix; + AvailabilityZones = new ChangeTrackingList(); + NetworkInfo = networkInfo; + VmSizeId = vmSizeId; + DiskInfo = diskInfo; + ImageInfo = imageInfo; + DomainInfo = domainInfo; + VmAdminCredentials = vmAdminCredentials; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The timestamp of the last update. + /// Friendly name to describe this version of the SessionHostConfiguration. + /// Provisioning state of the Session Host Configuration. + /// Hashtable that lists key/value pair tags to apply to the VMs. + /// The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + /// The prefix that should be associated with session host names. + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + /// Network information. + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + /// Disk information. + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + /// Image configurations of HostPool. + /// Domain configurations of session hosts. + /// Security information. + /// Local Admin credentials for session hosts. + /// Boot Diagnostics information. + /// Keeps track of any properties unknown to the library. + internal SessionHostConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? version, string friendlyName, ProvisioningStateSHC? provisioningState, IDictionary vmTags, string vmLocation, string vmResourceGroup, string vmNamePrefix, IList availabilityZones, NetworkInfoProperties networkInfo, string vmSizeId, DiskInfoProperties diskInfo, Uri customConfigurationScriptUri, ImageInfoProperties imageInfo, DomainInfoProperties domainInfo, SecurityInfoProperties securityInfo, KeyVaultCredentialsProperties vmAdminCredentials, BootDiagnosticsInfoProperties bootDiagnosticsInfo, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Version = version; + FriendlyName = friendlyName; + ProvisioningState = provisioningState; + VmTags = vmTags; + VmLocation = vmLocation; + VmResourceGroup = vmResourceGroup; + VmNamePrefix = vmNamePrefix; + AvailabilityZones = availabilityZones; + NetworkInfo = networkInfo; + VmSizeId = vmSizeId; + DiskInfo = diskInfo; + CustomConfigurationScriptUri = customConfigurationScriptUri; + ImageInfo = imageInfo; + DomainInfo = domainInfo; + SecurityInfo = securityInfo; + VmAdminCredentials = vmAdminCredentials; + BootDiagnosticsInfo = bootDiagnosticsInfo; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionHostConfigurationData() + { + } + + /// The timestamp of the last update. + [WirePath("properties.version")] + public DateTimeOffset? Version { get; } + /// Friendly name to describe this version of the SessionHostConfiguration. + [WirePath("properties.friendlyName")] + public string FriendlyName { get; set; } + /// Provisioning state of the Session Host Configuration. + [WirePath("properties.provisioningState")] + public ProvisioningStateSHC? ProvisioningState { get; } + /// Hashtable that lists key/value pair tags to apply to the VMs. + [WirePath("properties.vmTags")] + public IDictionary VmTags { get; } + /// The Location for the session host to be created in. It will default to the location of the hostpool if not provided. + [WirePath("properties.vmLocation")] + public string VmLocation { get; set; } + /// The ResourceGroup for the session hosts to be created in. It will default to the ResourceGroup of the hostpool if not provided. + [WirePath("properties.vmResourceGroup")] + public string VmResourceGroup { get; set; } + /// The prefix that should be associated with session host names. + [WirePath("properties.vmNamePrefix")] + public string VmNamePrefix { get; set; } + /// Value for availability zones to be used by the session host. Should be from [1,2,3]. + [WirePath("properties.availabilityZones")] + public IList AvailabilityZones { get; } + /// Network information. + [WirePath("properties.networkInfo")] + public NetworkInfoProperties NetworkInfo { get; set; } + /// The id of the size of a virtual machine connected to a hostpool. Example: Standard_D2as_v6. + [WirePath("properties.vmSizeId")] + public string VmSizeId { get; set; } + /// Disk information. + internal DiskInfoProperties DiskInfo { get; set; } + /// The disk type used by virtual machine in hostpool session host. + [WirePath("properties.diskInfo.type")] + public VirtualMachineDiskType? VirtualMachineDiskType + { + get => DiskInfo is null ? default(VirtualMachineDiskType?) : DiskInfo.VirtualMachineDiskType; + set + { + DiskInfo = value.HasValue ? new DiskInfoProperties(value.Value) : null; + } + } + + /// The uri to the storage blob containing the arm template to be run on the virtual machine after provisioning. + [WirePath("properties.customConfigurationScriptUrl")] + public Uri CustomConfigurationScriptUri { get; set; } + /// Image configurations of HostPool. + [WirePath("properties.imageInfo")] + public ImageInfoProperties ImageInfo { get; set; } + /// Domain configurations of session hosts. + [WirePath("properties.domainInfo")] + public DomainInfoProperties DomainInfo { get; set; } + /// Security information. + [WirePath("properties.securityInfo")] + public SecurityInfoProperties SecurityInfo { get; set; } + /// Local Admin credentials for session hosts. + [WirePath("properties.vmAdminCredentials")] + public KeyVaultCredentialsProperties VmAdminCredentials { get; set; } + /// Boot Diagnostics information. + [WirePath("properties.bootDiagnosticsInfo")] + public BootDiagnosticsInfoProperties BootDiagnosticsInfo { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationResource.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationResource.Serialization.cs new file mode 100644 index 000000000000..14aa5f931a85 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class SessionHostConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SessionHostConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SessionHostConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationResource.cs new file mode 100644 index 000000000000..f42a595824d1 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostConfigurationResource.cs @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A Class representing a SessionHostConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetSessionHostConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetSessionHostConfiguration method. + /// + public partial class SessionHostConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The hostPoolName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sessionHostConfigurationClientDiagnostics; + private readonly SessionHostConfigurationsRestOperations _sessionHostConfigurationRestClient; + private readonly SessionHostConfigurationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DesktopVirtualization/hostPools/sessionHostConfigurations"; + + /// Initializes a new instance of the class for mocking. + protected SessionHostConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SessionHostConfigurationResource(ArmClient client, SessionHostConfigurationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal SessionHostConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sessionHostConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sessionHostConfigurationApiVersion); + _sessionHostConfigurationRestClient = new SessionHostConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sessionHostConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SessionHostConfigurationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SessionHostConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default + /// + /// + /// Operation Id + /// SessionHostConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostConfigurationClientDiagnostics.CreateScope("SessionHostConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _sessionHostConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SessionHostConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SessionHostConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default + /// + /// + /// Operation Id + /// SessionHostConfigurations_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostConfigurationClientDiagnostics.CreateScope("SessionHostConfigurationResource.Get"); + scope.Start(); + try + { + var response = _sessionHostConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SessionHostConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SessionHostConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default + /// + /// + /// Operation Id + /// SessionHostConfigurations_Update + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, SessionHostConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sessionHostConfigurationClientDiagnostics.CreateScope("SessionHostConfigurationResource.Update"); + scope.Start(); + try + { + var response = await _sessionHostConfigurationRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(new SessionHostConfigurationOperationSource(Client), _sessionHostConfigurationClientDiagnostics, Pipeline, _sessionHostConfigurationRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SessionHostConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default + /// + /// + /// Operation Id + /// SessionHostConfigurations_Update + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, SessionHostConfigurationPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sessionHostConfigurationClientDiagnostics.CreateScope("SessionHostConfigurationResource.Update"); + scope.Start(); + try + { + var response = _sessionHostConfigurationRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(new SessionHostConfigurationOperationSource(Client), _sessionHostConfigurationClientDiagnostics, Pipeline, _sessionHostConfigurationRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a SessionHostConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default + /// + /// + /// Operation Id + /// SessionHostConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SessionHostConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sessionHostConfigurationClientDiagnostics.CreateScope("SessionHostConfigurationResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sessionHostConfigurationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(new SessionHostConfigurationOperationSource(Client), _sessionHostConfigurationClientDiagnostics, Pipeline, _sessionHostConfigurationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a SessionHostConfiguration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default + /// + /// + /// Operation Id + /// SessionHostConfigurations_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing SessionHostConfiguration definitions. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SessionHostConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sessionHostConfigurationClientDiagnostics.CreateScope("SessionHostConfigurationResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sessionHostConfigurationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(new SessionHostConfigurationOperationSource(Client), _sessionHostConfigurationClientDiagnostics, Pipeline, _sessionHostConfigurationRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.Serialization.cs index cb495bb2db73..4ba3a751c302 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.Serialization.cs @@ -121,6 +121,16 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("updateErrorMessage"u8); writer.WriteStringValue(UpdateErrorMessage); } + if (options.Format != "W" && Optional.IsDefined(LastSessionHostUpdateOn)) + { + writer.WritePropertyName("lastSessionHostUpdateTime"u8); + writer.WriteStringValue(LastSessionHostUpdateOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(SessionHostConfiguration)) + { + writer.WritePropertyName("sessionHostConfiguration"u8); + writer.WriteStringValue(SessionHostConfiguration); + } if (options.Format != "W" && Optional.IsCollectionDefined(SessionHostHealthCheckResults)) { writer.WritePropertyName("sessionHostHealthCheckResults"u8); @@ -174,6 +184,8 @@ internal static SessionHostData DeserializeSessionHostData(JsonElement element, SessionHostUpdateState? updateState = default; DateTimeOffset? lastUpdateTime = default; string updateErrorMessage = default; + DateTimeOffset? lastSessionHostUpdateTime = default; + string sessionHostConfiguration = default; IReadOnlyList sessionHostHealthCheckResults = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -324,6 +336,20 @@ internal static SessionHostData DeserializeSessionHostData(JsonElement element, updateErrorMessage = property0.Value.GetString(); continue; } + if (property0.NameEquals("lastSessionHostUpdateTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + { + continue; + } + lastSessionHostUpdateTime = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("sessionHostConfiguration"u8)) + { + sessionHostConfiguration = property0.Value.GetString(); + continue; + } if (property0.NameEquals("sessionHostHealthCheckResults"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -368,6 +394,8 @@ internal static SessionHostData DeserializeSessionHostData(JsonElement element, updateState, lastUpdateTime, updateErrorMessage, + lastSessionHostUpdateTime, + sessionHostConfiguration, sessionHostHealthCheckResults ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -746,6 +774,45 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastSessionHostUpdateOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastSessionHostUpdateTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastSessionHostUpdateOn)) + { + builder.Append(" lastSessionHostUpdateTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastSessionHostUpdateOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SessionHostConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sessionHostConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SessionHostConfiguration)) + { + builder.Append(" sessionHostConfiguration: "); + if (SessionHostConfiguration.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SessionHostConfiguration}'''"); + } + else + { + builder.AppendLine($"'{SessionHostConfiguration}'"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SessionHostHealthCheckResults), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.cs index 564aa47c5f00..c5d64e62c868 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostData.cs @@ -78,9 +78,11 @@ public SessionHostData() /// Update state of a SessionHost. /// The timestamp of the last update. /// The error message. + /// The last time update was completed. + /// SessionHostConfiguration version reference at the time the update is initiated, in the format of date time. Example: 2024-04-26T04:56:45Z. /// List of SessionHostHealthCheckReports. /// Keeps track of any properties unknown to the library. - internal SessionHostData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string objectId, DateTimeOffset? lastHeartBeatOn, int? sessions, string agentVersion, bool? allowNewSession, string vmId, ResourceIdentifier resourceId, string assignedUser, string friendlyName, SessionHostStatus? status, DateTimeOffset? statusTimestamp, string osVersion, string sxsStackVersion, SessionHostUpdateState? updateState, DateTimeOffset? lastUpdatedOn, string updateErrorMessage, IReadOnlyList sessionHostHealthCheckResults, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal SessionHostData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string objectId, DateTimeOffset? lastHeartBeatOn, int? sessions, string agentVersion, bool? allowNewSession, string vmId, ResourceIdentifier resourceId, string assignedUser, string friendlyName, SessionHostStatus? status, DateTimeOffset? statusTimestamp, string osVersion, string sxsStackVersion, SessionHostUpdateState? updateState, DateTimeOffset? lastUpdatedOn, string updateErrorMessage, DateTimeOffset? lastSessionHostUpdateOn, string sessionHostConfiguration, IReadOnlyList sessionHostHealthCheckResults, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { ObjectId = objectId; LastHeartBeatOn = lastHeartBeatOn; @@ -98,6 +100,8 @@ internal SessionHostData(ResourceIdentifier id, string name, ResourceType resour UpdateState = updateState; LastUpdatedOn = lastUpdatedOn; UpdateErrorMessage = updateErrorMessage; + LastSessionHostUpdateOn = lastSessionHostUpdateOn; + SessionHostConfiguration = sessionHostConfiguration; SessionHostHealthCheckResults = sessionHostHealthCheckResults; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -150,6 +154,12 @@ internal SessionHostData(ResourceIdentifier id, string name, ResourceType resour /// The error message. [WirePath("properties.updateErrorMessage")] public string UpdateErrorMessage { get; set; } + /// The last time update was completed. + [WirePath("properties.lastSessionHostUpdateTime")] + public DateTimeOffset? LastSessionHostUpdateOn { get; } + /// SessionHostConfiguration version reference at the time the update is initiated, in the format of date time. Example: 2024-04-26T04:56:45Z. + [WirePath("properties.sessionHostConfiguration")] + public string SessionHostConfiguration { get; } /// List of SessionHostHealthCheckReports. [WirePath("properties.sessionHostHealthCheckResults")] public IReadOnlyList SessionHostHealthCheckResults { get; } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementData.Serialization.cs new file mode 100644 index 000000000000..726ea00546a4 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementData.Serialization.cs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class SessionHostManagementData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("scheduledDateTimeZone"u8); + writer.WriteStringValue(ScheduledDateTimeZone); + writer.WritePropertyName("update"u8); + writer.WriteObjectValue(Update, options); + writer.WriteEndObject(); + } + + SessionHostManagementData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SessionHostManagementData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSessionHostManagementData(document.RootElement, options); + } + + internal static SessionHostManagementData DeserializeSessionHostManagementData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + string scheduledDateTimeZone = default; + HostPoolUpdateConfigurationProperties update = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("scheduledDateTimeZone"u8)) + { + scheduledDateTimeZone = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("update"u8)) + { + update = HostPoolUpdateConfigurationProperties.DeserializeHostPoolUpdateConfigurationProperties(property0.Value, options); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SessionHostManagementData( + id, + name, + type, + systemData, + scheduledDateTimeZone, + update, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScheduledDateTimeZone), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scheduledDateTimeZone: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ScheduledDateTimeZone)) + { + builder.Append(" scheduledDateTimeZone: "); + if (ScheduledDateTimeZone.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ScheduledDateTimeZone}'''"); + } + else + { + builder.AppendLine($"'{ScheduledDateTimeZone}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Update), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" update: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Update)) + { + builder.Append(" update: "); + BicepSerializationHelpers.AppendChildObject(builder, Update, options, 4, false, " update: "); + } + } + + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(SessionHostManagementData)} does not support writing '{options.Format}' format."); + } + } + + SessionHostManagementData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSessionHostManagementData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SessionHostManagementData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementData.cs new file mode 100644 index 000000000000..8a8fa7827725 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementData.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.DesktopVirtualization.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A class representing the SessionHostManagement data model. + /// Represents a SessionHostManagement definition. + /// + public partial class SessionHostManagementData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. + /// Parameters for a hostpool update. + /// or is null. + public SessionHostManagementData(string scheduledDateTimeZone, HostPoolUpdateConfigurationProperties update) + { + Argument.AssertNotNull(scheduledDateTimeZone, nameof(scheduledDateTimeZone)); + Argument.AssertNotNull(update, nameof(update)); + + ScheduledDateTimeZone = scheduledDateTimeZone; + Update = update; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. + /// Parameters for a hostpool update. + /// Keeps track of any properties unknown to the library. + internal SessionHostManagementData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string scheduledDateTimeZone, HostPoolUpdateConfigurationProperties update, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ScheduledDateTimeZone = scheduledDateTimeZone; + Update = update; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SessionHostManagementData() + { + } + + /// Time zone for sessionHostManagement operations as defined in https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set if useLocalTime is true. + [WirePath("properties.scheduledDateTimeZone")] + public string ScheduledDateTimeZone { get; set; } + /// Parameters for a hostpool update. + [WirePath("properties.update")] + public HostPoolUpdateConfigurationProperties Update { get; set; } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementResource.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementResource.Serialization.cs new file mode 100644 index 000000000000..a7f45d57026c --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + public partial class SessionHostManagementResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SessionHostManagementData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SessionHostManagementData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementResource.cs new file mode 100644 index 000000000000..c5711ef7c361 --- /dev/null +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostManagementResource.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.DesktopVirtualization.Models; + +namespace Azure.ResourceManager.DesktopVirtualization +{ + /// + /// A Class representing a SessionHostManagement along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetSessionHostManagementResource method. + /// Otherwise you can get one from its parent resource using the GetSessionHostManagement method. + /// + public partial class SessionHostManagementResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The hostPoolName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string hostPoolName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sessionHostManagementClientDiagnostics; + private readonly SessionHostManagementsRestOperations _sessionHostManagementRestClient; + private readonly ClientDiagnostics _initiateSessionHostUpdateClientDiagnostics; + private readonly InitiateSessionHostUpdateRestOperations _initiateSessionHostUpdateRestClient; + private readonly ClientDiagnostics _controlSessionHostUpdateClientDiagnostics; + private readonly ControlSessionHostUpdateRestOperations _controlSessionHostUpdateRestClient; + private readonly ClientDiagnostics _sessionHostManagementsUpdateStatusClientDiagnostics; + private readonly SessionHostManagementsUpdateStatusRestOperations _sessionHostManagementsUpdateStatusRestClient; + private readonly SessionHostManagementData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DesktopVirtualization/hostPools/sessionHostManagements"; + + /// Initializes a new instance of the class for mocking. + protected SessionHostManagementResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SessionHostManagementResource(ArmClient client, SessionHostManagementData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal SessionHostManagementResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sessionHostManagementClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sessionHostManagementApiVersion); + _sessionHostManagementRestClient = new SessionHostManagementsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sessionHostManagementApiVersion); + _initiateSessionHostUpdateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _initiateSessionHostUpdateRestClient = new InitiateSessionHostUpdateRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _controlSessionHostUpdateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _controlSessionHostUpdateRestClient = new ControlSessionHostUpdateRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _sessionHostManagementsUpdateStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _sessionHostManagementsUpdateStatusRestClient = new SessionHostManagementsUpdateStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SessionHostManagementData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a SessionHostManagement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default + /// + /// + /// Operation Id + /// SessionHostManagements_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostManagementClientDiagnostics.CreateScope("SessionHostManagementResource.Get"); + scope.Start(); + try + { + var response = await _sessionHostManagementRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SessionHostManagementResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a SessionHostManagement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default + /// + /// + /// Operation Id + /// SessionHostManagements_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostManagementClientDiagnostics.CreateScope("SessionHostManagementResource.Get"); + scope.Start(); + try + { + var response = _sessionHostManagementRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SessionHostManagementResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SessionHostManagement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default + /// + /// + /// Operation Id + /// SessionHostManagements_Update + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SessionHostManagementPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sessionHostManagementClientDiagnostics.CreateScope("SessionHostManagementResource.Update"); + scope.Start(); + try + { + var response = await _sessionHostManagementRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SessionHostManagementResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a SessionHostManagement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default + /// + /// + /// Operation Id + /// SessionHostManagements_Update + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SessionHostManagementPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sessionHostManagementClientDiagnostics.CreateScope("SessionHostManagementResource.Update"); + scope.Start(); + try + { + var response = _sessionHostManagementRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken); + return Response.FromValue(new SessionHostManagementResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a SessionHostManagement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default + /// + /// + /// Operation Id + /// SessionHostManagements_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SessionHostManagementData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sessionHostManagementClientDiagnostics.CreateScope("SessionHostManagementResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sessionHostManagementRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _sessionHostManagementRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new SessionHostManagementResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a SessionHostManagement. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default + /// + /// + /// Operation Id + /// SessionHostManagements_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing SessionHostManagement definitions. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SessionHostManagementData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sessionHostManagementClientDiagnostics.CreateScope("SessionHostManagementResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sessionHostManagementRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var uri = _sessionHostManagementRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new DesktopVirtualizationArmOperation(Response.FromValue(new SessionHostManagementResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Initiates a hostpool update or schedule an update for the future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate + /// + /// + /// Operation Id + /// InitiateSessionHostUpdate_Post + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// Object containing the definition for properties to be used in the sessionHostUpdate validation. + /// The cancellation token to use. + public virtual async Task PostInitiateSessionHostUpdateAsync(UpdateSessionHostsRequestBody updateSessionHostsRequestBody = null, CancellationToken cancellationToken = default) + { + using var scope = _initiateSessionHostUpdateClientDiagnostics.CreateScope("SessionHostManagementResource.PostInitiateSessionHostUpdate"); + scope.Start(); + try + { + var response = await _initiateSessionHostUpdateRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, updateSessionHostsRequestBody, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Initiates a hostpool update or schedule an update for the future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate + /// + /// + /// Operation Id + /// InitiateSessionHostUpdate_Post + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// Object containing the definition for properties to be used in the sessionHostUpdate validation. + /// The cancellation token to use. + public virtual Response PostInitiateSessionHostUpdate(UpdateSessionHostsRequestBody updateSessionHostsRequestBody = null, CancellationToken cancellationToken = default) + { + using var scope = _initiateSessionHostUpdateClientDiagnostics.CreateScope("SessionHostManagementResource.PostInitiateSessionHostUpdate"); + scope.Start(); + try + { + var response = _initiateSessionHostUpdateRestClient.Post(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, updateSessionHostsRequestBody, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Control update of a hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate + /// + /// + /// Operation Id + /// ControlSessionHostUpdate_Post + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing control action for hostpool update. + /// The cancellation token to use. + /// is null. + public virtual async Task PostControlSessionHostUpdateAsync(WaitUntil waitUntil, HostPoolUpdateControlParameter hostPoolUpdateControlParameter, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(hostPoolUpdateControlParameter, nameof(hostPoolUpdateControlParameter)); + + using var scope = _controlSessionHostUpdateClientDiagnostics.CreateScope("SessionHostManagementResource.PostControlSessionHostUpdate"); + scope.Start(); + try + { + var response = await _controlSessionHostUpdateRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, hostPoolUpdateControlParameter, cancellationToken).ConfigureAwait(false); + var operation = new DesktopVirtualizationArmOperation(_controlSessionHostUpdateClientDiagnostics, Pipeline, _controlSessionHostUpdateRestClient.CreatePostRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, hostPoolUpdateControlParameter).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Control update of a hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate + /// + /// + /// Operation Id + /// ControlSessionHostUpdate_Post + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Object containing control action for hostpool update. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation PostControlSessionHostUpdate(WaitUntil waitUntil, HostPoolUpdateControlParameter hostPoolUpdateControlParameter, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(hostPoolUpdateControlParameter, nameof(hostPoolUpdateControlParameter)); + + using var scope = _controlSessionHostUpdateClientDiagnostics.CreateScope("SessionHostManagementResource.PostControlSessionHostUpdate"); + scope.Start(); + try + { + var response = _controlSessionHostUpdateRestClient.Post(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, hostPoolUpdateControlParameter, cancellationToken); + var operation = new DesktopVirtualizationArmOperation(_controlSessionHostUpdateClientDiagnostics, Pipeline, _controlSessionHostUpdateRestClient.CreatePostRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, hostPoolUpdateControlParameter).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the session host update status for a given hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostUpdateStatuses/default + /// + /// + /// Operation Id + /// SessionHostManagementsUpdateStatus_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetSessionHostManagementsUpdateStatuAsync(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostManagementsUpdateStatusClientDiagnostics.CreateScope("SessionHostManagementResource.GetSessionHostManagementsUpdateStatu"); + scope.Start(); + try + { + var response = await _sessionHostManagementsUpdateStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the session host update status for a given hostpool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostUpdateStatuses/default + /// + /// + /// Operation Id + /// SessionHostManagementsUpdateStatus_Get + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetSessionHostManagementsUpdateStatu(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostManagementsUpdateStatusClientDiagnostics.CreateScope("SessionHostManagementResource.GetSessionHostManagementsUpdateStatu"); + scope.Start(); + try + { + var response = _sessionHostManagementsUpdateStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs index 4a4feebf385e..fb022d368ec4 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/SessionHostResource.cs @@ -36,6 +36,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _sessionHostClientDiagnostics; private readonly SessionHostsRestOperations _sessionHostRestClient; + private readonly ClientDiagnostics _sessionHostClientDiagnostics0; + private readonly SessionHostRestOperations _sessionHostRestClient0; private readonly SessionHostData _data; /// Gets the resource type for the operations. @@ -63,6 +65,8 @@ internal SessionHostResource(ArmClient client, ResourceIdentifier id) : base(cli _sessionHostClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string sessionHostApiVersion); _sessionHostRestClient = new SessionHostsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sessionHostApiVersion); + _sessionHostClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DesktopVirtualization", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _sessionHostRestClient = new SessionHostRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -109,7 +113,7 @@ public virtual UserSessionCollection GetUserSessions() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -140,7 +144,7 @@ public virtual async Task> GetUserSessionAsync(str /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -171,7 +175,7 @@ public virtual Response GetUserSession(string userSessionId /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -211,7 +215,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -251,7 +255,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -296,7 +300,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -341,7 +345,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? force = null, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -384,7 +388,7 @@ public virtual async Task> UpdateAsync(SessionHost /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -413,5 +417,73 @@ public virtual Response Update(SessionHostPatch patch, bool throw; } } + + /// + /// Retry provisioning on a SessionHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning + /// + /// + /// Operation Id + /// SessionHost_RetryProvisioning + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// The cancellation token to use. + public virtual async Task RetryProvisioningSessionHostAsync(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostClientDiagnostics.CreateScope("SessionHostResource.RetryProvisioningSessionHost"); + scope.Start(); + try + { + var response = await _sessionHostRestClient.RetryProvisioningAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Retry provisioning on a SessionHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning + /// + /// + /// Operation Id + /// SessionHost_RetryProvisioning + /// + /// + /// Default Api Version + /// 2024-08-08-preview + /// + /// + /// + /// The cancellation token to use. + public virtual Response RetryProvisioningSessionHost(CancellationToken cancellationToken = default) + { + using var scope = _sessionHostClientDiagnostics.CreateScope("SessionHostResource.RetryProvisioningSessionHost"); + scope.Start(); + try + { + var response = _sessionHostRestClient.RetryProvisioning(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionCollection.cs index 9417f20af7d9..3e3449899e53 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string userSes /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string userSessionId, Cancellat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -187,7 +187,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = nu /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -220,7 +220,7 @@ public virtual Pageable GetAll(int? pageSize = null, bool? /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -263,7 +263,7 @@ public virtual async Task> ExistsAsync(string userSessionId, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -306,7 +306,7 @@ public virtual Response Exists(string userSessionId, CancellationToken can /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -351,7 +351,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionResource.cs index 8239a83aa58e..acf783443dce 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/UserSessionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -273,7 +273,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? force = null, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task DisconnectAsync(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -349,7 +349,7 @@ public virtual Response Disconnect(CancellationToken cancellationToken = default /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -388,7 +388,7 @@ public virtual async Task SendMessageAsync(UserSessionMessage sendMess /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationCollection.cs index 84122d060881..c971033854c6 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string applicationName, /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSi /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(int? pageSize = null, /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -365,7 +365,7 @@ public virtual async Task> ExistsAsync(string applicationName, Ca /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string applicationName, CancellationToken c /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupCollection.cs index db5f602715d8..bc777c5ed176 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string applicationG /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -325,7 +325,7 @@ public virtual Pageable GetAll(string filter = /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> ExistsAsync(string applicationGroupNam /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -411,7 +411,7 @@ public virtual Response Exists(string applicationGroupName, CancellationTo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.Serialization.cs index 9849e7a7d922..0de82da58b11 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.Serialization.cs @@ -57,7 +57,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); } if (Optional.IsDefined(Sku)) { @@ -195,7 +196,8 @@ internal static VirtualApplicationGroupData DeserializeVirtualApplicationGroupDa { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } if (property.NameEquals("sku"u8)) diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs index f5ff1a068478..281763459fc2 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupData.cs @@ -82,9 +82,9 @@ public VirtualApplicationGroupData(AzureLocation location, ResourceIdentifier ho /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// Keeps track of any properties unknown to the library. internal VirtualApplicationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, ResourceIdentifier hostPoolId, ResourceIdentifier workspaceId, VirtualApplicationGroupType applicationGroupType, bool? isCloudPCResource, bool? showInFeed, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -143,13 +143,13 @@ internal VirtualApplicationGroupData() /// The etag field is *not* required. If it is provided in the response body, it must 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. [WirePath("etag")] public ETag? ETag { get; } - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// The resource model definition representing SKU. [WirePath("sku")] public DesktopVirtualizationSku Sku { get; set; } - /// Gets or sets the plan. + /// Plan for the resource. [WirePath("plan")] public ArmPlan Plan { get; set; } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs index e3499220abfa..53927e7f492a 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationGroupResource.cs @@ -115,7 +115,7 @@ public virtual VirtualApplicationCollection GetVirtualApplications() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -146,7 +146,7 @@ public virtual async Task> GetVirtualApplic /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual VirtualDesktopCollection GetVirtualDesktops() /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetVirtualDesktopAsy /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -246,7 +246,7 @@ public virtual Response GetVirtualDesktop(string desktop /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -326,7 +326,7 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -414,7 +414,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -498,7 +498,7 @@ public virtual Response Update(VirtualApplicati /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -527,7 +527,7 @@ public virtual AsyncPageable GetStartMenuIte /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -556,7 +556,7 @@ public virtual Pageable GetStartMenuItems(in /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -618,7 +618,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -680,7 +680,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -737,7 +737,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -794,7 +794,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -854,7 +854,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationResource.cs index 864c1cef4bb9..3e35caded145 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualApplicationResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(Virt /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopCollection.cs index ea22250af43c..562a7bac2cf2 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string desk /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string desktopName, Cancella /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -187,7 +187,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize = /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -220,7 +220,7 @@ public virtual Pageable GetAll(int? pageSize = null, boo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -263,7 +263,7 @@ public virtual async Task> ExistsAsync(string desktopName, Cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -306,7 +306,7 @@ public virtual Response Exists(string desktopName, CancellationToken cance /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -351,7 +351,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopResource.cs index 7425dac21067..a08547df3000 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualDesktopResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task> UpdateAsync(VirtualD /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceCollection.cs index 9a803d5ff4f8..217842f146f4 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string wo /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string workspaceName, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(int? pageSize /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(int? pageSize = null, b /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -409,7 +409,7 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.Serialization.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.Serialization.cs index 1fec4fe22e1b..6345ec496148 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.Serialization.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.Serialization.cs @@ -57,7 +57,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); } if (Optional.IsDefined(Sku)) { @@ -219,7 +220,8 @@ internal static VirtualWorkspaceData DeserializeVirtualWorkspaceData(JsonElement { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } if (property.NameEquals("sku"u8)) diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs index 907903d5edc7..46c4e804f666 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceData.cs @@ -76,9 +76,9 @@ public VirtualWorkspaceData(AzureLocation location) : base(location) /// The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. /// The etag field is *not* required. If it is provided in the response body, it must 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. - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). /// The resource model definition representing SKU. - /// Gets or sets the plan. + /// Plan for the resource. /// Keeps track of any properties unknown to the library. internal VirtualWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string objectId, string description, string friendlyName, IList applicationGroupReferences, bool? isCloudPCResource, DesktopVirtualizationPublicNetworkAccess? publicNetworkAccess, IReadOnlyList privateEndpointConnections, ResourceIdentifier managedBy, string kind, ETag? etag, ManagedServiceIdentity identity, DesktopVirtualizationSku sku, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -133,13 +133,13 @@ internal VirtualWorkspaceData() /// The etag field is *not* required. If it is provided in the response body, it must 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. [WirePath("etag")] public ETag? ETag { get; } - /// Gets or sets the identity. Current supported identity types: SystemAssigned. + /// Managed service identity (system assigned and/or user assigned identities). [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// The resource model definition representing SKU. [WirePath("sku")] public DesktopVirtualizationSku Sku { get; set; } - /// Gets or sets the plan. + /// Plan for the resource. [WirePath("plan")] public ArmPlan Plan { get; set; } } diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs index 8df1f7a58767..440430780b59 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/VirtualWorkspaceResource.cs @@ -115,7 +115,7 @@ public virtual WorkspacePrivateEndpointConnectionCollection GetWorkspacePrivateE /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -146,7 +146,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -177,7 +177,7 @@ public virtual Response GetWorkspace /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -217,7 +217,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -387,7 +387,7 @@ public virtual async Task> UpdateAsync(Virtua /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -429,7 +429,7 @@ public virtual Response Update(VirtualWorkspacePatch p /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -458,7 +458,7 @@ public virtual AsyncPageable GetPr /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// @@ -487,7 +487,7 @@ public virtual Pageable GetPrivate /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -549,7 +549,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -611,7 +611,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -668,7 +668,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -725,7 +725,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -785,7 +785,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs index 7badf4867d49..dbd5779da493 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string p /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(Cance /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs index d7cc80f7a684..6406b61cd189 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/Generated/WorkspacePrivateEndpointConnectionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource @@ -318,7 +318,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-03 + /// 2024-08-08-preview /// /// /// Resource diff --git a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md index cac13ec01357..740c196cfd1c 100644 --- a/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md +++ b/sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: true csharp: true library-name: DesktopVirtualization namespace: Azure.ResourceManager.DesktopVirtualization -require: https://github.com/Azure/azure-rest-api-specs/blob/ec07fc78c6c25b68107f8ff419d137ffecced005/specification/desktopvirtualization/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/desktopvirtualization/resource-manager/readme.md # tag: package-2024-04 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/desktopvirtualization/ci.mgmt.yml b/sdk/desktopvirtualization/ci.mgmt.yml index 3d6f40025c77..b6af32cc15c3 100644 --- a/sdk/desktopvirtualization/ci.mgmt.yml +++ b/sdk/desktopvirtualization/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/desktopvirtualization/ci.mgmt.yml - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/desktopvirtualization/ci.mgmt.yml + - sdk/desktopvirtualization/Azure.ResourceManager.DesktopVirtualization/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devcenter/ci.mgmt.yml b/sdk/devcenter/ci.mgmt.yml index 136d77bbba6d..cfa8320239dd 100644 --- a/sdk/devcenter/ci.mgmt.yml +++ b/sdk/devcenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devcenter/ci.mgmt.yml - sdk/devcenter/Azure.ResourceManager.DevCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devcenter/ci.mgmt.yml + - sdk/devcenter/Azure.ResourceManager.DevCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceprovisioningservices/ci.mgmt.yml b/sdk/deviceprovisioningservices/ci.mgmt.yml index f9c94973a324..733989d927dc 100644 --- a/sdk/deviceprovisioningservices/ci.mgmt.yml +++ b/sdk/deviceprovisioningservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/deviceprovisioningservices/ci.mgmt.yml - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceprovisioningservices/ci.mgmt.yml + - sdk/deviceprovisioningservices/Azure.ResourceManager.DeviceProvisioningServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceregistry/ci.mgmt.yml b/sdk/deviceregistry/ci.mgmt.yml index 05fffe301114..271e718d8676 100644 --- a/sdk/deviceregistry/ci.mgmt.yml +++ b/sdk/deviceregistry/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/deviceregistry/ci.mgmt.yml - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceregistry/ci.mgmt.yml + - sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/deviceupdate/ci.mgmt.yml b/sdk/deviceupdate/ci.mgmt.yml index c1315e462bb9..d8abd00a2256 100644 --- a/sdk/deviceupdate/ci.mgmt.yml +++ b/sdk/deviceupdate/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/deviceupdate/ci.mgmt.yml - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/deviceupdate/ci.mgmt.yml + - sdk/deviceupdate/Azure.ResourceManager.DeviceUpdate/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devopsinfrastructure/ci.mgmt.yml b/sdk/devopsinfrastructure/ci.mgmt.yml index 0f2db1225cf0..8e463b9f3794 100644 --- a/sdk/devopsinfrastructure/ci.mgmt.yml +++ b/sdk/devopsinfrastructure/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devopsinfrastructure/ci.mgmt.yml - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devopsinfrastructure/ci.mgmt.yml + - sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devspaces/ci.mgmt.yml b/sdk/devspaces/ci.mgmt.yml index b63234a64555..248d3c3143f0 100644 --- a/sdk/devspaces/ci.mgmt.yml +++ b/sdk/devspaces/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devspaces/ci.mgmt.yml - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devspaces/ci.mgmt.yml + - sdk/devspaces/Azure.ResourceManager.DevSpaces/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/devtestlabs/ci.mgmt.yml b/sdk/devtestlabs/ci.mgmt.yml index 1946409a6b75..7ee994de378b 100644 --- a/sdk/devtestlabs/ci.mgmt.yml +++ b/sdk/devtestlabs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/devtestlabs/ci.mgmt.yml - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/devtestlabs/ci.mgmt.yml + - sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/digitaltwins/ci.mgmt.yml b/sdk/digitaltwins/ci.mgmt.yml index a0e8233a36cf..a8766e215b7c 100644 --- a/sdk/digitaltwins/ci.mgmt.yml +++ b/sdk/digitaltwins/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/digitaltwins/ci.mgmt.yml - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/digitaltwins/ci.mgmt.yml + - sdk/digitaltwins/Azure.ResourceManager.DigitalTwins/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dns/ci.mgmt.yml b/sdk/dns/ci.mgmt.yml index 8357809b4e6f..ec6edfb21775 100644 --- a/sdk/dns/ci.mgmt.yml +++ b/sdk/dns/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/dns/ci.mgmt.yml - sdk/dns/Azure.ResourceManager.Dns/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dns/ci.mgmt.yml + - sdk/dns/Azure.ResourceManager.Dns/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dnsresolver/ci.mgmt.yml b/sdk/dnsresolver/ci.mgmt.yml index afa270cdc600..6b2569c11c49 100644 --- a/sdk/dnsresolver/ci.mgmt.yml +++ b/sdk/dnsresolver/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/dnsresolver/ci.mgmt.yml - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dnsresolver/ci.mgmt.yml + - sdk/dnsresolver/Azure.ResourceManager.DnsResolver/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/dynatrace/ci.mgmt.yml b/sdk/dynatrace/ci.mgmt.yml index f76bf3a316af..fe97a3c1f612 100644 --- a/sdk/dynatrace/ci.mgmt.yml +++ b/sdk/dynatrace/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/dynatrace/ci.mgmt.yml - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/dynatrace/ci.mgmt.yml + - sdk/dynatrace/Azure.ResourceManager.Dynatrace/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/edgeorder/ci.mgmt.yml b/sdk/edgeorder/ci.mgmt.yml index 4d1fbaa121f9..cb4d87c29a1b 100644 --- a/sdk/edgeorder/ci.mgmt.yml +++ b/sdk/edgeorder/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/edgeorder/ci.mgmt.yml - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgeorder/ci.mgmt.yml + - sdk/edgeorder/Azure.ResourceManager.EdgeOrder/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/edgezones/ci.mgmt.yml b/sdk/edgezones/ci.mgmt.yml index 9dc8d79aab30..ebed00842581 100644 --- a/sdk/edgezones/ci.mgmt.yml +++ b/sdk/edgezones/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/edgezones/ci.mgmt.yml - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/edgezones/ci.mgmt.yml + - sdk/edgezones/Azure.ResourceManager.EdgeZones/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/elastic/ci.mgmt.yml b/sdk/elastic/ci.mgmt.yml index 76ecd8b3923d..2e29070fce4a 100644 --- a/sdk/elastic/ci.mgmt.yml +++ b/sdk/elastic/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/elastic/ci.mgmt.yml - sdk/elastic/Azure.ResourceManager.Elastic/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elastic/ci.mgmt.yml + - sdk/elastic/Azure.ResourceManager.Elastic/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/elasticsan/ci.mgmt.yml b/sdk/elasticsan/ci.mgmt.yml index 7e2bb35dde21..dba4416415e9 100644 --- a/sdk/elasticsan/ci.mgmt.yml +++ b/sdk/elasticsan/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/elasticsan/ci.mgmt.yml - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/elasticsan/ci.mgmt.yml + - sdk/elasticsan/Azure.ResourceManager.ElasticSan/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/eventgrid/ci.mgmt.yml b/sdk/eventgrid/ci.mgmt.yml index cb02a1b84e8b..1b2eaffc0fdd 100644 --- a/sdk/eventgrid/ci.mgmt.yml +++ b/sdk/eventgrid/ci.mgmt.yml @@ -2,6 +2,7 @@ # This is for Track 2 managment plane SDK trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/eventgrid/ci.mgmt.yml - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventgrid/ci.mgmt.yml + - sdk/eventgrid/Azure.ResourceManager.EventGrid/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/eventhub/ci.mgmt.yml b/sdk/eventhub/ci.mgmt.yml index b7c0045fffb3..dadda2db6dc5 100644 --- a/sdk/eventhub/ci.mgmt.yml +++ b/sdk/eventhub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/eventhub/ci.mgmt.yml - sdk/eventhub/Azure.ResourceManager.EventHubs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/eventhub/ci.mgmt.yml + - sdk/eventhub/Azure.ResourceManager.EventHubs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/extendedlocation/ci.mgmt.yml b/sdk/extendedlocation/ci.mgmt.yml index 4fb53374be74..e9c6939e2b1d 100644 --- a/sdk/extendedlocation/ci.mgmt.yml +++ b/sdk/extendedlocation/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/extendedlocation/ci.mgmt.yml - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/extendedlocation/ci.mgmt.yml + - sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fabric/ci.mgmt.yml b/sdk/fabric/ci.mgmt.yml index d0bc6cea6eb9..5cc91d0c8722 100644 --- a/sdk/fabric/ci.mgmt.yml +++ b/sdk/fabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/fabric/ci.mgmt.yml - sdk/fabric/Azure.ResourceManager.Fabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fabric/ci.mgmt.yml + - sdk/fabric/Azure.ResourceManager.Fabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fleet/ci.mgmt.yml b/sdk/fleet/ci.mgmt.yml index 09a225882401..469d40cad619 100644 --- a/sdk/fleet/ci.mgmt.yml +++ b/sdk/fleet/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/fleet/ci.mgmt.yml - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fleet/ci.mgmt.yml + - sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/fluidrelay/ci.mgmt.yml b/sdk/fluidrelay/ci.mgmt.yml index d43dfe94d729..1673db3a9f26 100644 --- a/sdk/fluidrelay/ci.mgmt.yml +++ b/sdk/fluidrelay/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/fluidrelay/ci.mgmt.yml - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/fluidrelay/ci.mgmt.yml + - sdk/fluidrelay/Azure.ResourceManager.FluidRelay/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/frontdoor/ci.mgmt.yml b/sdk/frontdoor/ci.mgmt.yml index bff9dbcae78c..f19923a1b43d 100644 --- a/sdk/frontdoor/ci.mgmt.yml +++ b/sdk/frontdoor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/frontdoor/ci.mgmt.yml - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/frontdoor/ci.mgmt.yml + - sdk/frontdoor/Azure.ResourceManager.FrontDoor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/grafana/ci.mgmt.yml b/sdk/grafana/ci.mgmt.yml index a2f22e6ee33b..848173351b4d 100644 --- a/sdk/grafana/ci.mgmt.yml +++ b/sdk/grafana/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/grafana/ci.mgmt.yml - sdk/grafana/Azure.ResourceManager.Grafana/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/grafana/ci.mgmt.yml + - sdk/grafana/Azure.ResourceManager.Grafana/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/graphservices/ci.mgmt.yml b/sdk/graphservices/ci.mgmt.yml index 717a9a4a1963..ccd14b614b43 100644 --- a/sdk/graphservices/ci.mgmt.yml +++ b/sdk/graphservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/graphservices/ci.mgmt.yml - sdk/graphservices/Azure.ResourceManager.GraphServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/graphservices/ci.mgmt.yml + - sdk/graphservices/Azure.ResourceManager.GraphServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/guestconfiguration/ci.mgmt.yml b/sdk/guestconfiguration/ci.mgmt.yml index 5ebc59550f58..c2d2526d488b 100644 --- a/sdk/guestconfiguration/ci.mgmt.yml +++ b/sdk/guestconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/guestconfiguration/ci.mgmt.yml - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/guestconfiguration/ci.mgmt.yml + - sdk/guestconfiguration/Azure.ResourceManager.GuestConfiguration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hardwaresecuritymodules/ci.mgmt.yml b/sdk/hardwaresecuritymodules/ci.mgmt.yml index 21778711f99e..d94eea966253 100644 --- a/sdk/hardwaresecuritymodules/ci.mgmt.yml +++ b/sdk/hardwaresecuritymodules/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hardwaresecuritymodules/ci.mgmt.yml - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hardwaresecuritymodules/ci.mgmt.yml + - sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hdinsight/ci.mgmt.yml b/sdk/hdinsight/ci.mgmt.yml index 4df0a02f5c80..29d3b404c76a 100644 --- a/sdk/hdinsight/ci.mgmt.yml +++ b/sdk/hdinsight/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hdinsight/ci.mgmt.yml - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsight/ci.mgmt.yml + - sdk/hdinsight/Azure.ResourceManager.HDInsight/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hdinsightcontainers/ci.mgmt.yml b/sdk/hdinsightcontainers/ci.mgmt.yml index 69a7566e0caa..66a879d8fbcd 100644 --- a/sdk/hdinsightcontainers/ci.mgmt.yml +++ b/sdk/hdinsightcontainers/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hdinsightcontainers/ci.mgmt.yml - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hdinsightcontainers/ci.mgmt.yml + - sdk/hdinsightcontainers/Azure.ResourceManager.HDInsight.Containers/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthbot/ci.mgmt.yml b/sdk/healthbot/ci.mgmt.yml index 14bfc7f855e6..4c2698659502 100644 --- a/sdk/healthbot/ci.mgmt.yml +++ b/sdk/healthbot/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/healthbot/ci.mgmt.yml - sdk/healthbot/Azure.ResourceManager.HealthBot/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthbot/ci.mgmt.yml + - sdk/healthbot/Azure.ResourceManager.HealthBot/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthcareapis/ci.mgmt.yml b/sdk/healthcareapis/ci.mgmt.yml index 57030df35e56..6f02ac8fd023 100644 --- a/sdk/healthcareapis/ci.mgmt.yml +++ b/sdk/healthcareapis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/healthcareapis/ci.mgmt.yml - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthcareapis/ci.mgmt.yml + - sdk/healthcareapis/Azure.ResourceManager.HealthcareApis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/healthdataaiservices/ci.mgmt.yml b/sdk/healthdataaiservices/ci.mgmt.yml index 016a917c1e19..45857afa5722 100644 --- a/sdk/healthdataaiservices/ci.mgmt.yml +++ b/sdk/healthdataaiservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/healthdataaiservices/ci.mgmt.yml - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/healthdataaiservices/ci.mgmt.yml + - sdk/healthdataaiservices/Azure.ResourceManager.HealthDataAIServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridaks/ci.mgmt.yml b/sdk/hybridaks/ci.mgmt.yml index 552eb3298d3a..af3d82703d11 100644 --- a/sdk/hybridaks/ci.mgmt.yml +++ b/sdk/hybridaks/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridaks/ci.mgmt.yml - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridaks/ci.mgmt.yml + - sdk/hybridaks/Azure.ResourceManager.HybridContainerService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridcompute/ci.mgmt.yml b/sdk/hybridcompute/ci.mgmt.yml index d163a966512d..15f8656c399e 100644 --- a/sdk/hybridcompute/ci.mgmt.yml +++ b/sdk/hybridcompute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridcompute/ci.mgmt.yml - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridcompute/ci.mgmt.yml + - sdk/hybridcompute/Azure.ResourceManager.HybridCompute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridconnectivity/ci.mgmt.yml b/sdk/hybridconnectivity/ci.mgmt.yml index 9ccca42ef557..8d809d4d9633 100644 --- a/sdk/hybridconnectivity/ci.mgmt.yml +++ b/sdk/hybridconnectivity/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridconnectivity/ci.mgmt.yml - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridconnectivity/ci.mgmt.yml + - sdk/hybridconnectivity/Azure.ResourceManager.HybridConnectivity/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridkubernetes/ci.mgmt.yml b/sdk/hybridkubernetes/ci.mgmt.yml index fff768430c9d..bb98635a8e1c 100644 --- a/sdk/hybridkubernetes/ci.mgmt.yml +++ b/sdk/hybridkubernetes/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridkubernetes/ci.mgmt.yml - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridkubernetes/ci.mgmt.yml + - sdk/hybridkubernetes/Azure.ResourceManager.Kubernetes/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/hybridnetwork/ci.mgmt.yml b/sdk/hybridnetwork/ci.mgmt.yml index 35f71f8ae870..39412ff81f05 100644 --- a/sdk/hybridnetwork/ci.mgmt.yml +++ b/sdk/hybridnetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/hybridnetwork/ci.mgmt.yml - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/hybridnetwork/ci.mgmt.yml + - sdk/hybridnetwork/Azure.ResourceManager.HybridNetwork/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/informaticadatamanagement/ci.mgmt.yml b/sdk/informaticadatamanagement/ci.mgmt.yml index 03013cc9c90b..82d3bafd3f7f 100644 --- a/sdk/informaticadatamanagement/ci.mgmt.yml +++ b/sdk/informaticadatamanagement/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/informaticadatamanagement/ci.mgmt.yml - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/informaticadatamanagement/ci.mgmt.yml + - sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iot/ci.mgmt.yml b/sdk/iot/ci.mgmt.yml index 6260cd0d71f2..199578b03331 100644 --- a/sdk/iot/ci.mgmt.yml +++ b/sdk/iot/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/iot/ci.mgmt.yml - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iot/ci.mgmt.yml + - sdk/iot/Azure.ResourceManager.IotFirmwareDefense/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iotcentral/ci.mgmt.yml b/sdk/iotcentral/ci.mgmt.yml index 1702fd71c6dd..1225f99c37fd 100644 --- a/sdk/iotcentral/ci.mgmt.yml +++ b/sdk/iotcentral/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/iotcentral/ci.mgmt.yml - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iotcentral/ci.mgmt.yml + - sdk/iotcentral/Azure.ResourceManager.IotCentral/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/iothub/ci.mgmt.yml b/sdk/iothub/ci.mgmt.yml index 5eb9e999a89c..63fb10994eac 100644 --- a/sdk/iothub/ci.mgmt.yml +++ b/sdk/iothub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/iothub/ci.mgmt.yml - sdk/iothub/Azure.ResourceManager.IotHub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/iothub/ci.mgmt.yml + - sdk/iothub/Azure.ResourceManager.IotHub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/keyvault/ci.mgmt.yml b/sdk/keyvault/ci.mgmt.yml index b48c2f8d4ff4..8ad905079a0a 100644 --- a/sdk/keyvault/ci.mgmt.yml +++ b/sdk/keyvault/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/keyvault/ci.mgmt.yml - sdk/keyvault/Azure.ResourceManager.KeyVault/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/keyvault/ci.mgmt.yml + - sdk/keyvault/Azure.ResourceManager.KeyVault/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/kubernetesconfiguration/ci.mgmt.yml b/sdk/kubernetesconfiguration/ci.mgmt.yml index 4249ef57fa6e..d3fb470a7b6e 100644 --- a/sdk/kubernetesconfiguration/ci.mgmt.yml +++ b/sdk/kubernetesconfiguration/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/kubernetesconfiguration/ci.mgmt.yml - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kubernetesconfiguration/ci.mgmt.yml + - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/kusto/ci.mgmt.yml b/sdk/kusto/ci.mgmt.yml index 374cf1f0cb81..c410d1487d18 100644 --- a/sdk/kusto/ci.mgmt.yml +++ b/sdk/kusto/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/kusto/ci.mgmt.yml - sdk/kusto/Azure.ResourceManager.Kusto/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/kusto/ci.mgmt.yml + - sdk/kusto/Azure.ResourceManager.Kusto/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/labservices/ci.mgmt.yml b/sdk/labservices/ci.mgmt.yml index 48f80379ab14..f8a982072965 100644 --- a/sdk/labservices/ci.mgmt.yml +++ b/sdk/labservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/labservices/ci.mgmt.yml - sdk/labservices/Azure.ResourceManager.LabServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/labservices/ci.mgmt.yml + - sdk/labservices/Azure.ResourceManager.LabServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/loadtestservice/ci.mgmt.yml b/sdk/loadtestservice/ci.mgmt.yml index 4e3d99d42979..dfc32939e497 100644 --- a/sdk/loadtestservice/ci.mgmt.yml +++ b/sdk/loadtestservice/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/loadtestservice/ci.mgmt.yml - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/loadtestservice/ci.mgmt.yml + - sdk/loadtestservice/Azure.ResourceManager.LoadTesting/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/logic/ci.mgmt.yml b/sdk/logic/ci.mgmt.yml index b89b224082ee..5bed51facd34 100644 --- a/sdk/logic/ci.mgmt.yml +++ b/sdk/logic/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/logic/ci.mgmt.yml - sdk/logic/Azure.ResourceManager.Logic/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/logic/ci.mgmt.yml + - sdk/logic/Azure.ResourceManager.Logic/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/machinelearningcompute/ci.mgmt.yml b/sdk/machinelearningcompute/ci.mgmt.yml index 9ea84fdf4d15..5ea619231191 100644 --- a/sdk/machinelearningcompute/ci.mgmt.yml +++ b/sdk/machinelearningcompute/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/machinelearningcompute/ci.mgmt.yml - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningcompute/ci.mgmt.yml + - sdk/machinelearningcompute/Azure.ResourceManager.MachineLearningCompute/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/machinelearningservices/ci.mgmt.yml b/sdk/machinelearningservices/ci.mgmt.yml index 457299ab20b9..3a99ed224fc2 100644 --- a/sdk/machinelearningservices/ci.mgmt.yml +++ b/sdk/machinelearningservices/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/machinelearningservices/ci.mgmt.yml - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/machinelearningservices/ci.mgmt.yml + - sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/maintenance/ci.mgmt.yml b/sdk/maintenance/ci.mgmt.yml index c49cc1565d6d..94c552b69f26 100644 --- a/sdk/maintenance/ci.mgmt.yml +++ b/sdk/maintenance/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/maintenance/ci.mgmt.yml - sdk/maintenance/Azure.ResourceManager.Maintenance/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maintenance/ci.mgmt.yml + - sdk/maintenance/Azure.ResourceManager.Maintenance/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managednetwork/ci.mgmt.yml b/sdk/managednetwork/ci.mgmt.yml index 431d66d1245b..08c9f3d0ce55 100644 --- a/sdk/managednetwork/ci.mgmt.yml +++ b/sdk/managednetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managednetwork/ci.mgmt.yml - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetwork/ci.mgmt.yml + - sdk/managednetwork/Azure.ResourceManager.ManagedNetwork/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managednetworkfabric/ci.mgmt.yml b/sdk/managednetworkfabric/ci.mgmt.yml index aa6b571b04e2..3212ad45bbde 100644 --- a/sdk/managednetworkfabric/ci.mgmt.yml +++ b/sdk/managednetworkfabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managednetworkfabric/ci.mgmt.yml - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managednetworkfabric/ci.mgmt.yml + - sdk/managednetworkfabric/Azure.ResourceManager.ManagedNetworkFabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managedserviceidentity/ci.mgmt.yml b/sdk/managedserviceidentity/ci.mgmt.yml index c8f3a187f918..c9cd4b0f235a 100644 --- a/sdk/managedserviceidentity/ci.mgmt.yml +++ b/sdk/managedserviceidentity/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managedserviceidentity/ci.mgmt.yml - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedserviceidentity/ci.mgmt.yml + - sdk/managedserviceidentity/Azure.ResourceManager.ManagedServiceIdentities/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managedservices/ci.mgmt.yml b/sdk/managedservices/ci.mgmt.yml index d6c0ccd16eef..88360bb2defa 100644 --- a/sdk/managedservices/ci.mgmt.yml +++ b/sdk/managedservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managedservices/ci.mgmt.yml - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managedservices/ci.mgmt.yml + - sdk/managedservices/Azure.ResourceManager.ManagedServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/managementpartner/ci.mgmt.yml b/sdk/managementpartner/ci.mgmt.yml index 52c8e762088e..6fdd0118e1b9 100644 --- a/sdk/managementpartner/ci.mgmt.yml +++ b/sdk/managementpartner/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/managementpartner/ci.mgmt.yml - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/managementpartner/ci.mgmt.yml + - sdk/managementpartner/Azure.ResourceManager.ManagementPartner/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/maps/ci.mgmt.yml b/sdk/maps/ci.mgmt.yml index 2f16079cab2e..7ee4f1ddad3c 100644 --- a/sdk/maps/ci.mgmt.yml +++ b/sdk/maps/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/maps/ci.mgmt.yml - sdk/maps/Azure.ResourceManager.Maps/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/maps/ci.mgmt.yml + - sdk/maps/Azure.ResourceManager.Maps/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/marketplace/ci.mgmt.yml b/sdk/marketplace/ci.mgmt.yml index e6574bdb3039..42bc8a147b30 100644 --- a/sdk/marketplace/ci.mgmt.yml +++ b/sdk/marketplace/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/marketplace/ci.mgmt.yml - sdk/marketplace/Azure.ResourceManager.Marketplace/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplace/ci.mgmt.yml + - sdk/marketplace/Azure.ResourceManager.Marketplace/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/marketplaceordering/ci.mgmt.yml b/sdk/marketplaceordering/ci.mgmt.yml index 2b1f8721902e..c602647fb32d 100644 --- a/sdk/marketplaceordering/ci.mgmt.yml +++ b/sdk/marketplaceordering/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/marketplaceordering/ci.mgmt.yml - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/marketplaceordering/ci.mgmt.yml + - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mediaservices/ci.mgmt.yml b/sdk/mediaservices/ci.mgmt.yml index 55656f3ae48b..201ecc9d995d 100644 --- a/sdk/mediaservices/ci.mgmt.yml +++ b/sdk/mediaservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mediaservices/ci.mgmt.yml - sdk/mediaservices/Azure.ResourceManager.Media/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mediaservices/ci.mgmt.yml + - sdk/mediaservices/Azure.ResourceManager.Media/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/migrationdiscoverysap/ci.mgmt.yml b/sdk/migrationdiscoverysap/ci.mgmt.yml index f5eb354d28e7..26c079f3d6f5 100644 --- a/sdk/migrationdiscoverysap/ci.mgmt.yml +++ b/sdk/migrationdiscoverysap/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/migrationdiscoverysap/ci.mgmt.yml - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/migrationdiscoverysap/ci.mgmt.yml + - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mixedreality/ci.mgmt.yml b/sdk/mixedreality/ci.mgmt.yml index 81c0c2744232..d342a10a32e0 100644 --- a/sdk/mixedreality/ci.mgmt.yml +++ b/sdk/mixedreality/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/mixedreality/ci.mgmt.yml - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mixedreality/ci.mgmt.yml + - sdk/mixedreality/Azure.ResourceManager.MixedReality/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mobilenetwork/ci.mgmt.yml b/sdk/mobilenetwork/ci.mgmt.yml index 8a68e6749ba7..325154bfbfb7 100644 --- a/sdk/mobilenetwork/ci.mgmt.yml +++ b/sdk/mobilenetwork/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mobilenetwork/ci.mgmt.yml - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mobilenetwork/ci.mgmt.yml + - sdk/mobilenetwork/Azure.ResourceManager.MobileNetwork/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mongocluster/ci.mgmt.yml b/sdk/mongocluster/ci.mgmt.yml index d2eafe7877dd..10f6e93db8bc 100644 --- a/sdk/mongocluster/ci.mgmt.yml +++ b/sdk/mongocluster/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mongocluster/ci.mgmt.yml - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mongocluster/ci.mgmt.yml + - sdk/mongocluster/Azure.ResourceManager.MongoCluster/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/monitor/ci.mgmt.yml b/sdk/monitor/ci.mgmt.yml index 8beeded4e3b9..5933fd35d9e5 100644 --- a/sdk/monitor/ci.mgmt.yml +++ b/sdk/monitor/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/monitor/ci.mgmt.yml - sdk/monitor/Azure.ResourceManager.Monitor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/monitor/ci.mgmt.yml + - sdk/monitor/Azure.ResourceManager.Monitor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/mysql/ci.mgmt.yml b/sdk/mysql/ci.mgmt.yml index e1521b4ed568..2ba5627ae3fc 100644 --- a/sdk/mysql/ci.mgmt.yml +++ b/sdk/mysql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/mysql/ci.mgmt.yml - sdk/mysql/Azure.ResourceManager.MySql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/mysql/ci.mgmt.yml + - sdk/mysql/Azure.ResourceManager.MySql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/neonpostgres/ci.mgmt.yml b/sdk/neonpostgres/ci.mgmt.yml index 72d449fc7a16..00f734ba7230 100644 --- a/sdk/neonpostgres/ci.mgmt.yml +++ b/sdk/neonpostgres/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/neonpostgres/ci.mgmt.yml - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/neonpostgres/ci.mgmt.yml + - sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/netapp/ci.mgmt.yml b/sdk/netapp/ci.mgmt.yml index 05a683e910f5..5d0a3e741513 100644 --- a/sdk/netapp/ci.mgmt.yml +++ b/sdk/netapp/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/netapp/ci.mgmt.yml - sdk/netapp/Azure.ResourceManager.NetApp/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/netapp/ci.mgmt.yml + - sdk/netapp/Azure.ResourceManager.NetApp/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/network/ci.mgmt.yml b/sdk/network/ci.mgmt.yml index edf77de02a49..f69378e6c236 100644 --- a/sdk/network/ci.mgmt.yml +++ b/sdk/network/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/network/ci.mgmt.yml - sdk/network/Azure.ResourceManager.Network/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/network/ci.mgmt.yml + - sdk/network/Azure.ResourceManager.Network/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkanalytics/ci.mgmt.yml b/sdk/networkanalytics/ci.mgmt.yml index 9ece072ce867..52934a1bad24 100644 --- a/sdk/networkanalytics/ci.mgmt.yml +++ b/sdk/networkanalytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/networkanalytics/ci.mgmt.yml - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkanalytics/ci.mgmt.yml + - sdk/networkanalytics/Azure.ResourceManager.NetworkAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkcloud/ci.mgmt.yml b/sdk/networkcloud/ci.mgmt.yml index f6c281af22a9..940f908b8c75 100644 --- a/sdk/networkcloud/ci.mgmt.yml +++ b/sdk/networkcloud/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/networkcloud/ci.mgmt.yml - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkcloud/ci.mgmt.yml + - sdk/networkcloud/Azure.ResourceManager.NetworkCloud/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/networkfunction/ci.mgmt.yml b/sdk/networkfunction/ci.mgmt.yml index a3c743ef532a..b05cf6e5e1cc 100644 --- a/sdk/networkfunction/ci.mgmt.yml +++ b/sdk/networkfunction/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/networkfunction/ci.mgmt.yml - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/networkfunction/ci.mgmt.yml + - sdk/networkfunction/Azure.ResourceManager.NetworkFunction/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/newrelicobservability/ci.mgmt.yml b/sdk/newrelicobservability/ci.mgmt.yml index d01ef74cd749..599cfd845f2c 100644 --- a/sdk/newrelicobservability/ci.mgmt.yml +++ b/sdk/newrelicobservability/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/newrelicobservability/ci.mgmt.yml - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/newrelicobservability/ci.mgmt.yml + - sdk/newrelicobservability/Azure.ResourceManager.NewRelicObservability/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/nginx/ci.mgmt.yml b/sdk/nginx/ci.mgmt.yml index f701b26a561a..39e047ce0015 100644 --- a/sdk/nginx/ci.mgmt.yml +++ b/sdk/nginx/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/nginx/ci.mgmt.yml - sdk/nginx/Azure.ResourceManager.Nginx/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/nginx/ci.mgmt.yml + - sdk/nginx/Azure.ResourceManager.Nginx/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/notificationhubs/ci.mgmt.yml b/sdk/notificationhubs/ci.mgmt.yml index ba5a26631dd4..8d9f15f7758b 100644 --- a/sdk/notificationhubs/ci.mgmt.yml +++ b/sdk/notificationhubs/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/notificationhubs/ci.mgmt.yml - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/notificationhubs/ci.mgmt.yml + - sdk/notificationhubs/Azure.ResourceManager.NotificationHubs/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/openenergyplatform/ci.mgmt.yml b/sdk/openenergyplatform/ci.mgmt.yml index 1ab74128b4db..f2394b80f6b9 100644 --- a/sdk/openenergyplatform/ci.mgmt.yml +++ b/sdk/openenergyplatform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/openenergyplatform/ci.mgmt.yml - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/openenergyplatform/ci.mgmt.yml + - sdk/openenergyplatform/Azure.ResourceManager.EnergyServices/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/operationalinsights/ci.mgmt.yml b/sdk/operationalinsights/ci.mgmt.yml index d4c3b61dac40..9e588305c901 100644 --- a/sdk/operationalinsights/ci.mgmt.yml +++ b/sdk/operationalinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/operationalinsights/ci.mgmt.yml - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/operationalinsights/ci.mgmt.yml + - sdk/operationalinsights/Azure.ResourceManager.OperationalInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/oracle/ci.mgmt.yml b/sdk/oracle/ci.mgmt.yml index ccbd7c096ecf..760950dbd58a 100644 --- a/sdk/oracle/ci.mgmt.yml +++ b/sdk/oracle/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/oracle/ci.mgmt.yml - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/oracle/ci.mgmt.yml + - sdk/oracle/Azure.ResourceManager.OracleDatabase/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/orbital/ci.mgmt.yml b/sdk/orbital/ci.mgmt.yml index 701576d2fa62..2b2102df1da3 100644 --- a/sdk/orbital/ci.mgmt.yml +++ b/sdk/orbital/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/orbital/ci.mgmt.yml - sdk/orbital/Azure.ResourceManager.Orbital/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/orbital/ci.mgmt.yml + - sdk/orbital/Azure.ResourceManager.Orbital/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/paloaltonetworks.ngfw/ci.mgmt.yml b/sdk/paloaltonetworks.ngfw/ci.mgmt.yml index 77dca48de9ef..6348d3109683 100644 --- a/sdk/paloaltonetworks.ngfw/ci.mgmt.yml +++ b/sdk/paloaltonetworks.ngfw/ci.mgmt.yml @@ -1,4 +1,5 @@ trigger: none + pr: branches: include: @@ -11,6 +12,18 @@ pr: - sdk/paloaltonetworks.ngfw/ci.mgmt.yml - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/paloaltonetworks.ngfw/ci.mgmt.yml + - sdk/paloaltonetworks.ngfw/Azure.ResourceManager.PaloAltoNetworks.Ngfw/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/peering/ci.mgmt.yml b/sdk/peering/ci.mgmt.yml index 4d3d67e73949..cfef409531ee 100644 --- a/sdk/peering/ci.mgmt.yml +++ b/sdk/peering/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/peering/ci.mgmt.yml - sdk/peering/Azure.ResourceManager.Peering/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/peering/ci.mgmt.yml + - sdk/peering/Azure.ResourceManager.Peering/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/playwrighttesting/ci.mgmt.yml b/sdk/playwrighttesting/ci.mgmt.yml index 79addf69162c..b6422b373563 100644 --- a/sdk/playwrighttesting/ci.mgmt.yml +++ b/sdk/playwrighttesting/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/playwrighttesting/ci.mgmt.yml - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/playwrighttesting/ci.mgmt.yml + - sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/policyinsights/ci.mgmt.yml b/sdk/policyinsights/ci.mgmt.yml index 56fa5c3ead85..c0fa9e7dd917 100644 --- a/sdk/policyinsights/ci.mgmt.yml +++ b/sdk/policyinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/policyinsights/ci.mgmt.yml - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/policyinsights/ci.mgmt.yml + - sdk/policyinsights/Azure.ResourceManager.PolicyInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/postgresql/ci.mgmt.yml b/sdk/postgresql/ci.mgmt.yml index 77dbaed301ba..08dff06cd11f 100644 --- a/sdk/postgresql/ci.mgmt.yml +++ b/sdk/postgresql/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/postgresql/ci.mgmt.yml - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/postgresql/ci.mgmt.yml + - sdk/postgresql/Azure.ResourceManager.PostgreSql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/powerbidedicated/ci.mgmt.yml b/sdk/powerbidedicated/ci.mgmt.yml index 414f2b8ef0a9..951d3e8d0434 100644 --- a/sdk/powerbidedicated/ci.mgmt.yml +++ b/sdk/powerbidedicated/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/powerbidedicated/ci.mgmt.yml - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/powerbidedicated/ci.mgmt.yml + - sdk/powerbidedicated/Azure.ResourceManager.PowerBIDedicated/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/privatedns/ci.mgmt.yml b/sdk/privatedns/ci.mgmt.yml index 86401f2f9675..31c567bfe408 100644 --- a/sdk/privatedns/ci.mgmt.yml +++ b/sdk/privatedns/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/privatedns/ci.mgmt.yml - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/privatedns/ci.mgmt.yml + - sdk/privatedns/Azure.ResourceManager.PrivateDns/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/providerhub/ci.mgmt.yml b/sdk/providerhub/ci.mgmt.yml index 2c7f6ca61d3f..3de6a7f30b80 100644 --- a/sdk/providerhub/ci.mgmt.yml +++ b/sdk/providerhub/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/providerhub/ci.mgmt.yml - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/providerhub/ci.mgmt.yml + - sdk/providerhub/Azure.ResourceManager.ProviderHub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/purview/ci.mgmt.yml b/sdk/purview/ci.mgmt.yml index 226718ca583c..d5961aa8833a 100644 --- a/sdk/purview/ci.mgmt.yml +++ b/sdk/purview/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/purview/ci.mgmt.yml - sdk/purview/Azure.ResourceManager.Purview/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/purview/ci.mgmt.yml + - sdk/purview/Azure.ResourceManager.Purview/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/quantum/ci.mgmt.yml b/sdk/quantum/ci.mgmt.yml index 8562320fa7c7..6ee02d7799bd 100644 --- a/sdk/quantum/ci.mgmt.yml +++ b/sdk/quantum/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/quantum/ci.mgmt.yml - sdk/quantum/Azure.ResourceManager.Quantum/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quantum/ci.mgmt.yml + - sdk/quantum/Azure.ResourceManager.Quantum/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/qumulo/ci.mgmt.yml b/sdk/qumulo/ci.mgmt.yml index e89c4bea0e70..fe6e1fa253d3 100644 --- a/sdk/qumulo/ci.mgmt.yml +++ b/sdk/qumulo/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/qumulo/ci.mgmt.yml - sdk/qumulo/Azure.ResourceManager.Qumulo/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/qumulo/ci.mgmt.yml + - sdk/qumulo/Azure.ResourceManager.Qumulo/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/quota/ci.mgmt.yml b/sdk/quota/ci.mgmt.yml index f1f545ad13f1..9409730d342e 100644 --- a/sdk/quota/ci.mgmt.yml +++ b/sdk/quota/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/quota/ci.mgmt.yml - sdk/quota/Azure.ResourceManager.Quota/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/quota/ci.mgmt.yml + - sdk/quota/Azure.ResourceManager.Quota/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-backup/ci.mgmt.yml b/sdk/recoveryservices-backup/ci.mgmt.yml index 5edfd823e3c0..402121c0f72c 100644 --- a/sdk/recoveryservices-backup/ci.mgmt.yml +++ b/sdk/recoveryservices-backup/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices-backup/ci.mgmt.yml - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-backup/ci.mgmt.yml + - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-datareplication/ci.mgmt.yml b/sdk/recoveryservices-datareplication/ci.mgmt.yml index 2e3966d67a88..143f2e0317c3 100644 --- a/sdk/recoveryservices-datareplication/ci.mgmt.yml +++ b/sdk/recoveryservices-datareplication/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices-datareplication/ci.mgmt.yml - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-datareplication/ci.mgmt.yml + - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices-siterecovery/ci.mgmt.yml b/sdk/recoveryservices-siterecovery/ci.mgmt.yml index bded800f3ee2..3a8a3179d5a5 100644 --- a/sdk/recoveryservices-siterecovery/ci.mgmt.yml +++ b/sdk/recoveryservices-siterecovery/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices-siterecovery/ci.mgmt.yml - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices-siterecovery/ci.mgmt.yml + - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/recoveryservices/ci.mgmt.yml b/sdk/recoveryservices/ci.mgmt.yml index 0e7e6985f21c..d4a5e482dfa7 100644 --- a/sdk/recoveryservices/ci.mgmt.yml +++ b/sdk/recoveryservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/recoveryservices/ci.mgmt.yml - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservices/ci.mgmt.yml + - sdk/recoveryservices/Azure.ResourceManager.RecoveryServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/redis/ci.mgmt.yml b/sdk/redis/ci.mgmt.yml index 9e6845322580..dfc71e356b87 100644 --- a/sdk/redis/ci.mgmt.yml +++ b/sdk/redis/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/redis/ci.mgmt.yml - sdk/redis/Azure.ResourceManager.Redis/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redis/ci.mgmt.yml + - sdk/redis/Azure.ResourceManager.Redis/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/redisenterprise/ci.mgmt.yml b/sdk/redisenterprise/ci.mgmt.yml index 93641cfe3983..294ec0377bdf 100644 --- a/sdk/redisenterprise/ci.mgmt.yml +++ b/sdk/redisenterprise/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/redisenterprise/ci.mgmt.yml - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/redisenterprise/ci.mgmt.yml + - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/relay/ci.mgmt.yml b/sdk/relay/ci.mgmt.yml index b69a1efbd0f9..fc5a3764ebb5 100644 --- a/sdk/relay/ci.mgmt.yml +++ b/sdk/relay/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/relay/ci.mgmt.yml - sdk/relay/Azure.ResourceManager.Relay/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/relay/ci.mgmt.yml + - sdk/relay/Azure.ResourceManager.Relay/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/reservations/ci.mgmt.yml b/sdk/reservations/ci.mgmt.yml index c46c8c69cd2e..8effbcdd4424 100644 --- a/sdk/reservations/ci.mgmt.yml +++ b/sdk/reservations/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/reservations/ci.mgmt.yml - sdk/reservations/Azure.ResourceManager.Reservations/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/reservations/ci.mgmt.yml + - sdk/reservations/Azure.ResourceManager.Reservations/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourceconnector/ci.mgmt.yml b/sdk/resourceconnector/ci.mgmt.yml index 81269b9113c7..149f1805dab4 100644 --- a/sdk/resourceconnector/ci.mgmt.yml +++ b/sdk/resourceconnector/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourceconnector/ci.mgmt.yml - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourceconnector/ci.mgmt.yml + - sdk/resourceconnector/Azure.ResourceManager.ResourceConnector/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcegraph/ci.mgmt.yml b/sdk/resourcegraph/ci.mgmt.yml index 5abe050f7709..27656bcd16c2 100644 --- a/sdk/resourcegraph/ci.mgmt.yml +++ b/sdk/resourcegraph/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourcegraph/ci.mgmt.yml - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcegraph/ci.mgmt.yml + - sdk/resourcegraph/Azure.ResourceManager.ResourceGraph/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcehealth/ci.mgmt.yml b/sdk/resourcehealth/ci.mgmt.yml index fb0a27171a69..bf3868346c7b 100644 --- a/sdk/resourcehealth/ci.mgmt.yml +++ b/sdk/resourcehealth/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourcehealth/ci.mgmt.yml - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcehealth/ci.mgmt.yml + - sdk/resourcehealth/Azure.ResourceManager.ResourceHealth/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resourcemover/ci.mgmt.yml b/sdk/resourcemover/ci.mgmt.yml index 519b8a431926..bbb814c6a4f0 100644 --- a/sdk/resourcemover/ci.mgmt.yml +++ b/sdk/resourcemover/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resourcemover/ci.mgmt.yml - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resourcemover/ci.mgmt.yml + - sdk/resourcemover/Azure.ResourceManager.ResourceMover/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/resources/ci.mgmt.yml b/sdk/resources/ci.mgmt.yml index 3fefd5254c85..ff65cb96d07d 100644 --- a/sdk/resources/ci.mgmt.yml +++ b/sdk/resources/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/resources/ci.mgmt.yml - sdk/resources/Azure.ResourceManager.Resources/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/resources/ci.mgmt.yml + - sdk/resources/Azure.ResourceManager.Resources/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/search/ci.mgmt.yml b/sdk/search/ci.mgmt.yml index a8c2a632c1c8..63c0e200644f 100644 --- a/sdk/search/ci.mgmt.yml +++ b/sdk/search/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/search/ci.mgmt.yml - sdk/search/Azure.ResourceManager.Search/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/search/ci.mgmt.yml + - sdk/search/Azure.ResourceManager.Search/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securitycenter/ci.mgmt.yml b/sdk/securitycenter/ci.mgmt.yml index c728522efab2..6ed8ff4d67a9 100644 --- a/sdk/securitycenter/ci.mgmt.yml +++ b/sdk/securitycenter/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/securitycenter/ci.mgmt.yml - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitycenter/ci.mgmt.yml + - sdk/securitycenter/Azure.ResourceManager.SecurityCenter/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securitydevops/ci.mgmt.yml b/sdk/securitydevops/ci.mgmt.yml index c5a54a9ad206..972d98a7376e 100644 --- a/sdk/securitydevops/ci.mgmt.yml +++ b/sdk/securitydevops/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/securitydevops/ci.mgmt.yml - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securitydevops/ci.mgmt.yml + - sdk/securitydevops/Azure.ResourceManager.SecurityDevOps/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/securityinsights/ci.mgmt.yml b/sdk/securityinsights/ci.mgmt.yml index f1d428ebef90..0659cac2858f 100644 --- a/sdk/securityinsights/ci.mgmt.yml +++ b/sdk/securityinsights/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/securityinsights/ci.mgmt.yml - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/securityinsights/ci.mgmt.yml + - sdk/securityinsights/Azure.ResourceManager.SecurityInsights/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/selfhelp/ci.mgmt.yml b/sdk/selfhelp/ci.mgmt.yml index bb6a162210eb..ac13ec845ce7 100644 --- a/sdk/selfhelp/ci.mgmt.yml +++ b/sdk/selfhelp/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/selfhelp/ci.mgmt.yml - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/selfhelp/ci.mgmt.yml + - sdk/selfhelp/Azure.ResourceManager.SelfHelp/ + extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicebus/ci.mgmt.yml b/sdk/servicebus/ci.mgmt.yml index 02c45dc88e18..f2ead205ced6 100644 --- a/sdk/servicebus/ci.mgmt.yml +++ b/sdk/servicebus/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicebus/ci.mgmt.yml - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicebus/ci.mgmt.yml + - sdk/servicebus/Azure.ResourceManager.ServiceBus/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicefabric/ci.mgmt.yml b/sdk/servicefabric/ci.mgmt.yml index 430f48c8c87b..afc886a4f7f2 100644 --- a/sdk/servicefabric/ci.mgmt.yml +++ b/sdk/servicefabric/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicefabric/ci.mgmt.yml - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabric/ci.mgmt.yml + - sdk/servicefabric/Azure.ResourceManager.ServiceFabric/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicefabricmanagedclusters/ci.mgmt.yml b/sdk/servicefabricmanagedclusters/ci.mgmt.yml index e73289f589f4..022ac0f03cd1 100644 --- a/sdk/servicefabricmanagedclusters/ci.mgmt.yml +++ b/sdk/servicefabricmanagedclusters/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicefabricmanagedclusters/ci.mgmt.yml - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicefabricmanagedclusters/ci.mgmt.yml + - sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicelinker/ci.mgmt.yml b/sdk/servicelinker/ci.mgmt.yml index 77df314e977a..6069e04a3157 100644 --- a/sdk/servicelinker/ci.mgmt.yml +++ b/sdk/servicelinker/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicelinker/ci.mgmt.yml - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicelinker/ci.mgmt.yml + - sdk/servicelinker/Azure.ResourceManager.ServiceLinker/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/servicenetworking/ci.mgmt.yml b/sdk/servicenetworking/ci.mgmt.yml index b2332ae15224..4551f1325475 100644 --- a/sdk/servicenetworking/ci.mgmt.yml +++ b/sdk/servicenetworking/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/servicenetworking/ci.mgmt.yml - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/servicenetworking/ci.mgmt.yml + - sdk/servicenetworking/Azure.ResourceManager.ServiceNetworking/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/signalr/ci.mgmt.yml b/sdk/signalr/ci.mgmt.yml index c934ed4314fa..f066849c56a1 100644 --- a/sdk/signalr/ci.mgmt.yml +++ b/sdk/signalr/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/signalr/ci.mgmt.yml - sdk/signalr/Azure.ResourceManager.SignalR/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ci.mgmt.yml + - sdk/signalr/Azure.ResourceManager.SignalR/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sphere/ci.mgmt.yml b/sdk/sphere/ci.mgmt.yml index f3f33e9d00f4..749774244735 100644 --- a/sdk/sphere/ci.mgmt.yml +++ b/sdk/sphere/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/sphere/ci.mgmt.yml - sdk/sphere/Azure.ResourceManager.Sphere/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sphere/ci.mgmt.yml + - sdk/sphere/Azure.ResourceManager.Sphere/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/springappdiscovery/ci.mgmt.yml b/sdk/springappdiscovery/ci.mgmt.yml index 7676386684df..f86c14368089 100644 --- a/sdk/springappdiscovery/ci.mgmt.yml +++ b/sdk/springappdiscovery/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/springappdiscovery/ci.mgmt.yml - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/springappdiscovery/ci.mgmt.yml + - sdk/springappdiscovery/Azure.ResourceManager.SpringAppDiscovery/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sqlmanagement/ci.mgmt.yml b/sdk/sqlmanagement/ci.mgmt.yml index da93d03f2d33..8377a2663681 100644 --- a/sdk/sqlmanagement/ci.mgmt.yml +++ b/sdk/sqlmanagement/ci.mgmt.yml @@ -2,6 +2,7 @@ # This file is generated automatically and any changes will be lost. trigger: none + pr: branches: include: @@ -14,6 +15,18 @@ pr: - sdk/sqlmanagement/ci.mgmt.yml - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlmanagement/ci.mgmt.yml + - sdk/sqlmanagement/Azure.ResourceManager.Sql/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/sqlvirtualmachine/ci.mgmt.yml b/sdk/sqlvirtualmachine/ci.mgmt.yml index 28c6192fa86b..049e315855ed 100644 --- a/sdk/sqlvirtualmachine/ci.mgmt.yml +++ b/sdk/sqlvirtualmachine/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/sqlvirtualmachine/ci.mgmt.yml - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/sqlvirtualmachine/ci.mgmt.yml + - sdk/sqlvirtualmachine/Azure.ResourceManager.SqlVirtualMachine/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/standbypool/ci.mgmt.yml b/sdk/standbypool/ci.mgmt.yml index 0763a516e2c1..54ce1137a123 100644 --- a/sdk/standbypool/ci.mgmt.yml +++ b/sdk/standbypool/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/standbypool/ci.mgmt.yml - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/standbypool/ci.mgmt.yml + - sdk/standbypool/Azure.ResourceManager.StandbyPool/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storage/ci.mgmt.yml b/sdk/storage/ci.mgmt.yml index 95bc19b325d5..6f05608983be 100644 --- a/sdk/storage/ci.mgmt.yml +++ b/sdk/storage/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storage/ci.mgmt.yml - sdk/storage/Azure.ResourceManager.Storage/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storage/ci.mgmt.yml + - sdk/storage/Azure.ResourceManager.Storage/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storageactions/ci.mgmt.yml b/sdk/storageactions/ci.mgmt.yml index 27062b4565a8..b27838343a2e 100644 --- a/sdk/storageactions/ci.mgmt.yml +++ b/sdk/storageactions/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storageactions/ci.mgmt.yml - sdk/storageactions/Azure.ResourceManager.StorageActions/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storageactions/ci.mgmt.yml + - sdk/storageactions/Azure.ResourceManager.StorageActions/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagecache/ci.mgmt.yml b/sdk/storagecache/ci.mgmt.yml index c6abf63baf2c..84c922940939 100644 --- a/sdk/storagecache/ci.mgmt.yml +++ b/sdk/storagecache/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagecache/ci.mgmt.yml - sdk/storagecache/Azure.ResourceManager.StorageCache/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagecache/ci.mgmt.yml + - sdk/storagecache/Azure.ResourceManager.StorageCache/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagemover/ci.mgmt.yml b/sdk/storagemover/ci.mgmt.yml index e9055f49e1a9..4e45261a60aa 100644 --- a/sdk/storagemover/ci.mgmt.yml +++ b/sdk/storagemover/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagemover/ci.mgmt.yml - sdk/storagemover/Azure.ResourceManager.StorageMover/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagemover/ci.mgmt.yml + - sdk/storagemover/Azure.ResourceManager.StorageMover/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagepool/ci.mgmt.yml b/sdk/storagepool/ci.mgmt.yml index 2178fc390757..6592a12a262a 100644 --- a/sdk/storagepool/ci.mgmt.yml +++ b/sdk/storagepool/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagepool/ci.mgmt.yml - sdk/storagepool/Azure.ResourceManager.StoragePool/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagepool/ci.mgmt.yml + - sdk/storagepool/Azure.ResourceManager.StoragePool/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/storagesync/ci.mgmt.yml b/sdk/storagesync/ci.mgmt.yml index a8789947c687..b9fcbb66b30f 100644 --- a/sdk/storagesync/ci.mgmt.yml +++ b/sdk/storagesync/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/storagesync/ci.mgmt.yml - sdk/storagesync/Azure.ResourceManager.StorageSync/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/storagesync/ci.mgmt.yml + - sdk/storagesync/Azure.ResourceManager.StorageSync/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/streamanalytics/ci.mgmt.yml b/sdk/streamanalytics/ci.mgmt.yml index 09d108a1a7d9..860cd851bbd1 100644 --- a/sdk/streamanalytics/ci.mgmt.yml +++ b/sdk/streamanalytics/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/streamanalytics/ci.mgmt.yml - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/streamanalytics/ci.mgmt.yml + - sdk/streamanalytics/Azure.ResourceManager.StreamAnalytics/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/subscription/ci.mgmt.yml b/sdk/subscription/ci.mgmt.yml index f9067b4c0af3..a00a0e9c56ad 100644 --- a/sdk/subscription/ci.mgmt.yml +++ b/sdk/subscription/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/subscription/ci.mgmt.yml - sdk/subscription/Azure.ResourceManager.Subscription/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/subscription/ci.mgmt.yml + - sdk/subscription/Azure.ResourceManager.Subscription/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/support/ci.mgmt.yml b/sdk/support/ci.mgmt.yml index 5a947c4c4939..d5c857ad8346 100644 --- a/sdk/support/ci.mgmt.yml +++ b/sdk/support/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/support/ci.mgmt.yml - sdk/support/Azure.ResourceManager.Support/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/support/ci.mgmt.yml + - sdk/support/Azure.ResourceManager.Support/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/synapse/ci.mgmt.yml b/sdk/synapse/ci.mgmt.yml index 0a089a504291..18c8132c4803 100644 --- a/sdk/synapse/ci.mgmt.yml +++ b/sdk/synapse/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/synapse/ci.mgmt.yml - sdk/synapse/Azure.ResourceManager.Synapse/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/synapse/ci.mgmt.yml + - sdk/synapse/Azure.ResourceManager.Synapse/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/terraform/ci.mgmt.yml b/sdk/terraform/ci.mgmt.yml index 82c4c1f05a4c..5f7b3d41fb27 100644 --- a/sdk/terraform/ci.mgmt.yml +++ b/sdk/terraform/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/terraform/ci.mgmt.yml - sdk/terraform/Azure.ResourceManager.Terraform/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/terraform/ci.mgmt.yml + - sdk/terraform/Azure.ResourceManager.Terraform/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/trafficmanager/ci.mgmt.yml b/sdk/trafficmanager/ci.mgmt.yml index 528f78b70b96..86b17c08ac4e 100644 --- a/sdk/trafficmanager/ci.mgmt.yml +++ b/sdk/trafficmanager/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/trafficmanager/ci.mgmt.yml - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trafficmanager/ci.mgmt.yml + - sdk/trafficmanager/Azure.ResourceManager.TrafficManager/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/trustedsigning/ci.mgmt.yml b/sdk/trustedsigning/ci.mgmt.yml index 5b67358a4477..07fb171ee416 100644 --- a/sdk/trustedsigning/ci.mgmt.yml +++ b/sdk/trustedsigning/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/trustedsigning/ci.mgmt.yml - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/trustedsigning/ci.mgmt.yml + - sdk/trustedsigning/Azure.ResourceManager.TrustedSigning/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/voiceservices/ci.mgmt.yml b/sdk/voiceservices/ci.mgmt.yml index a914d1640296..64ea2eb63c0f 100644 --- a/sdk/voiceservices/ci.mgmt.yml +++ b/sdk/voiceservices/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/voiceservices/ci.mgmt.yml - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/voiceservices/ci.mgmt.yml + - sdk/voiceservices/Azure.ResourceManager.VoiceServices/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/webpubsub/ci.mgmt.yml b/sdk/webpubsub/ci.mgmt.yml index 6bcb8439a2b0..a312a96feb5a 100644 --- a/sdk/webpubsub/ci.mgmt.yml +++ b/sdk/webpubsub/ci.mgmt.yml @@ -1,5 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -12,6 +13,18 @@ pr: - sdk/webpubsub/ci.mgmt.yml - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/webpubsub/ci.mgmt.yml + - sdk/webpubsub/Azure.ResourceManager.WebPubSub/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/websites/ci.mgmt.yml b/sdk/websites/ci.mgmt.yml index d67c580bc414..4dbf184acc87 100644 --- a/sdk/websites/ci.mgmt.yml +++ b/sdk/websites/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/websites/ci.mgmt.yml - sdk/websites/Azure.ResourceManager.AppService/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/websites/ci.mgmt.yml + - sdk/websites/Azure.ResourceManager.AppService/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/workloadmonitor/ci.mgmt.yml b/sdk/workloadmonitor/ci.mgmt.yml index 7c6a51fbe75c..e834be340ea9 100644 --- a/sdk/workloadmonitor/ci.mgmt.yml +++ b/sdk/workloadmonitor/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/workloadmonitor/ci.mgmt.yml - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloadmonitor/ci.mgmt.yml + - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: diff --git a/sdk/workloads/ci.mgmt.yml b/sdk/workloads/ci.mgmt.yml index e3457d69ceaa..bf3983053473 100644 --- a/sdk/workloads/ci.mgmt.yml +++ b/sdk/workloads/ci.mgmt.yml @@ -1,6 +1,7 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none + pr: branches: include: @@ -13,6 +14,18 @@ pr: - sdk/workloads/ci.mgmt.yml - sdk/workloads/Azure.ResourceManager.Workloads/ + + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/workloads/ci.mgmt.yml + - sdk/workloads/Azure.ResourceManager.Workloads/ + extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: